摘要: function isNumber(val) { var regPos = /^\d+(\.\d+)?$/; //非负浮点数 var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数 if(regPos.test(val) || regN... 阅读全文
posted @ 2018-05-02 18:36 neo_o 阅读(71588) 评论(3) 推荐(1)
摘要: /*转化函数*/ function(data, attributes) { let resData = data; let tree = []; for(let i = 0; i < resData.length; i++) { if(resData[i][attributes.parentId] === attributes.rootId) { let obj = { ... 阅读全文
posted @ 2018-05-02 18:30 neo_o 阅读(8910) 评论(0) 推荐(0)
摘要: function getCountDays(ym) { var curDate = new Date(ym); /* 获取当前月份 */ var curMonth = curDate.getMonth(); /* 生成实际的月份: 由于curMonth会比实际月份小1, 故需加1 */ curDat 阅读全文
posted @ 2018-05-02 18:16 neo_o 阅读(3703) 评论(0) 推荐(0)
摘要: 1.安装axios依赖包 npm install axios --save 2.新建js文件,命名js.js。 项目目录: axios.interceptors.request.use(function (config) { config.headers['Content-Type'] = 'app 阅读全文
posted @ 2018-05-02 18:06 neo_o 阅读(395) 评论(0) 推荐(0)

愿你的生活只有诗和远方