js
乔7426
这个作者很懒,什么都没留下…
展开
-
根据系统时间获得这个月的月初和月末
//当前日期 var d=new Date(); alert(d.toLocaleDateString()) //月初 var f = d.setDate(1); f = new Date(f); alert(f.toLocaleDateString()); //月末 var e=d.setDate(1); e=new Date(e); e=e.setMonth(d.getMonth()+1)...原创 2020-03-23 10:37:52 · 460 阅读 · 1 评论 -
js正则表达式提取汉字和去掉汉字
//只提取汉字 var str = "2020/3/1 上午10:23:47"; varreg=/[\u4e00-\u9fa5]/g; returnstr.match(reg).join(""); //去掉汉字 var str = "2020/3/1 上午10:23:47"; varreg=/[\u4e00-\u9fa5]/g; retu...原创 2020-03-23 10:36:43 · 1461 阅读 · 0 评论 -
vue和.net后台接口通讯des加密解密方法
1、npm下载 npm install crypto-js 2、创建一个des.js文件,内容如下: import CryptoJS from 'crypto-js' export const encryptCBC = (text, textKey) => { // 密钥转成16进制的字符串 var key = CryptoJS.enc.Utf8.parse(textKe...原创 2020-03-20 14:14:55 · 508 阅读 · 0 评论 -
vue根据获取的数据动态循环渲染多个echart(多个dom节点,多个ID)
//在dom节点加载之后调用渲染echart仪表盘方法,this.$nextTick(function(){ } <divclass="chart"> <divclass="geo"v-for="(dataval,index)indataVal":key="index":id="forId(index)"></div> ...原创 2020-03-20 14:06:15 · 2604 阅读 · 1 评论 -
js获取当前时间的前一天/后一天
var dataV= new Date(); var pastDate = new Date(dataV.getTime() - 24*60*60*1000); //前一天 var nextDate = new Date(dataV.getTime() + 24*60*60*1000); //后一天原创 2020-03-16 10:03:55 · 317 阅读 · 0 评论