Error in v-on handler: “TypeError: this.$confirm is not a function“

Error in v-on handler: “TypeError: this.$confirm is not a function“

在vue项目中从全局引入element-ui改为按需引入后报错

解决方法:

1 引入messageBox 插件
import {MessageBox} from ‘element-ui’

2 在vue 的原型对象上挂载confirm
Vue.prototype.$confirm = MessageBox.confirmError in v-on handler: “TypeError: this.$confirm is not a function“

 

 

上一篇:Hung-watchdog


下一篇:搭建 Watchdog(信息收集)