1.当前时间各种格式
用了momentjs
2.定时器
created(){
this.updateMin();
this.updateDay();
this.timeInterval=setInterval(this.updateMin,1000);
this.dayInterval=setInterval(this.updateDay,1000*6);
}
beforeDestroy() {
clearInterval(this.timeInterval);
clearInterval(this.dayInterval);
}
https://www.cnblogs.com/xiaohuochai/p/5773183.html
3. const let var区别
https://www.cnblogs.com/ksl666/p/5944718.html
4.农历
抄抄改改好久,最后还是直接使用了github的一个轮子
https://github.com/jjonline/calendar.js
调用另一个JS文件中的函数
import lunar from './calendar';
this.lunarDate = lunar.myLunar(...)
导入的js文件中,要有导出
function myLunar(y, m, d) {
...
}
export default {
myLunar
}
//--------or---------
export function lineOption(option, data){
//...
return data;
}
来源:CSDN
作者:拾-亦
链接:https://blog.csdn.net/u010969088/article/details/91045527