效果如图:
methods里面写方法:
changeTime(val) {//去掉-var reg = new RegExp("-", "g");var a = val.replace(reg, "");//去掉空格var regs = new RegExp(" ", "g");var b = a.replace(regs, "");//去掉冒号var regss = new RegExp(":", "g");var c = b.replace(regss, "");},
调用:
add() {// this.showDialog = true;var date = new Date();this.code = date.getTime();},
打印结果:
add() {// this.showDialog = true;var date = new Date();this.code = date.getTime();console.log(this.code,"this.code");},