亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue mount失敗

vue mount失敗

守候你守候我 2019-02-09 23:19:23
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); }-->
查看完整描述

1 回答

?
烙印99

TA貢獻1829條經驗 獲得超13個贊

export default {


install: (Vue) => {

    Vue.prototype.$alert.......

}

}


我記得Vue的插件需要有個install方法吧


查看完整回答
反對 回復 2019-02-16
  • 1 回答
  • 0 關注
  • 385 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號