12 2020 档案

摘要:1 /** 2 * 解决两个数相加精度丢失问题 3 * @param a 4 * @param b 5 * @returns {Number} 6 */ 7 function floatAdd(a, b) { 8 var c, d, e; 9 if(undefined==a||null==a||"" 阅读全文
posted @ 2020-12-24 17:18 onlywu 阅读(316) 评论(0) 推荐(0)
摘要:// 获取“-”之前的字符串过滤器 let getHGbeforeStr = value =>{ if(!value) return '' if(value.search("-") !== -1){ return value.split("-").shift() } else { return '' 阅读全文
posted @ 2020-12-24 16:55 onlywu 阅读(295) 评论(0) 推荐(0)
摘要:在 JavaScript 浮点数做数学运算的时候,你经常会发现一些问题,举几个例子: // 加法 // 0.1 + 0.2 = 0.30000000000000004 // 0.7 + 0.1 = 0.7999999999999999 // 0.2 + 0.4 = 0.600000000000000 阅读全文
posted @ 2020-12-24 16:18 onlywu 阅读(2562) 评论(0) 推荐(0)
摘要:<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <style> ul,li{padding:10px;list-style:none;} li{border:1px solid red;} /*li{ 阅读全文
posted @ 2020-12-21 16:38 onlywu 阅读(1277) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-12-21 16:03 onlywu 阅读(1499) 评论(0) 推荐(0)
摘要:安装lodash的依赖: npm安装: cnpm i lodash -S yarn命令安装: yarn add lodash 然并卵: //lodash导入 import _ from ‘lodash‘; //在vue的js中使用 const result = _.assign();//只能点出as 阅读全文
posted @ 2020-12-18 11:54 onlywu 阅读(2084) 评论(0) 推荐(0)
摘要:import Vue from 'vue' import axios from 'axios' import router from '@/router' import qs from 'qs' import merge from 'lodash/merge' import {clearLoginI 阅读全文
posted @ 2020-12-18 11:45 onlywu 阅读(1261) 评论(0) 推荐(0)
摘要:/** * 解决el-cascader控件 最后一级暂无数据仍然显示。 * @param data * @returns {Array} */ export function getTreeData(data){ for(let i=0;i<data.length;i++){ if(data[i]. 阅读全文
posted @ 2020-12-18 11:20 onlywu 阅读(1717) 评论(0) 推荐(2)
摘要:时间格式化 /*** * 13位时间戳格式化 * @param time 13位时间戳 * @param fmt * @returns {string} */ export function formatTimestamp(time = 0, fmt = 'yyyy-MM-dd hh:mm:ss') 阅读全文
posted @ 2020-12-18 11:15 onlywu 阅读(1038) 评论(0) 推荐(0)