import {
ToastPlugin}
from
'vux' 全局引入这个组件
main.js全局引入
//封装消息提示
Vue.
prototype.
msg =
function (
text) {
//如果你需要让一个工具函数在每个组件可用,可以把方法挂载到 Vue.prototype上。那么组件代码里this.method()
Vue.
$vux.
toast.
show({
text:
text,
type:
'text'
})
}
然后在其他vue文本里用this.msg('内容')
则会自动弹出内容提示;
则会自动弹出内容提示;