vue加载自定义的js文件方法【点击查看详情】
在做项目中需要自定义弹出框。就自己写了一个。效果图;遇见的问题;怎么加载自定义的js文件。vue-插件这必须要看。然后就是自己写了。,export default{ install(Vue){ var tpl;// 弹出框 Vue.prototype.showAlter = (title,msg) =>{ var alterTpl = Vue.extend({ // 1、创建构造器,挂载到文档以后的地方 document.body.appendChild(tpl);} Vue.mixin({ methods: { hideAlter: function () { document.body.removeChild(tpl);} } }) }}。使用;
相关视频/文章