600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > vue项目引入第三方js插件

vue项目引入第三方js插件

时间:2019-10-19 21:10:37

相关推荐

vue项目引入第三方js插件

1、引入第三方js文件,npm安装不了

2、在methods下使用

图片看不清请看下面代码

updateTime() {setInterval(()=>{var cd = new Date();var lunar = calendarNU.solar2lunar();//此处是引用插件方法this.time = this.$options.methods.zeroPadding(cd.getHours(), 2) + ':' + this.$options.methods.zeroPadding(cd.getMinutes(), 2) + ':' + this.$options.methods.zeroPadding(cd.getSeconds(), 2);this.calendar = this.$options.methods.zeroPadding(cd.getFullYear(), 4) + '-' + this.$options.methods.zeroPadding(cd.getMonth()+1, 2) + '-' + this.$options.methods.zeroPadding(cd.getDate(), 2) + ' ' + this.week[cd.getDay()];},1000)},

第三方js插件需要暴露对象或方法来使用:如下图

2、导入的方法有问题 已更正 。请了解es6的语法/#docs/module

转载自:/web1/p/8819471.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。