import Vue from 'vue';export default ()=>{ Vue.prototype.$alert= (options)=>{ return new Promise((resolve, reject)=>{ let alert = Vue.extend(require('./alert.vue')); options.callback=resolve let instance=new alert({ data: options }); instance.$mount(); console.log(instance) document.body.appendChild(instance.$el); }) }}在其他vue組件調用 this.$alert() 時失敗Failed to mount component: template or render function not definedvue-cli構建。。。是instance.$mount() 掛載失敗。。this.$alert()可以調用生成的東西是這個<!--function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }-->
vue mount失敗
守候你守候我
2019-02-09 23:19:23