项目中main.js中调用了,
import { AlertPlugin } from 'vux'
Vue.use(AlertPlugin);
Vue.prototype.$msgbox = (title,msg) => {
this.$vux.alert.show({
title: title,
content: msg
});
}
这样子调用会报错Error in mounted hook: "TypeError: Cannot read property 'alert' of undefined"。
求问要如何才可以把alert组件像这样子挂载到全局函数上去?
相关分类