Error in v-on handler: “TypeError: this.$confirm is not a function”
控制台出现这个错误!!!
原因:
使用了消息提示框,没有引入MessageBox
logout() {
this.$confirm(`确定进行-[退出]-操作?`, "提示 :", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
});}
解决:
在main.js中导入element-ui中的messagebox-----
import {MessageBox} from 'element-ui'
//并把消息提示框挂载到全局使用
Vue.prototype.$confirm=MessageBox.confirm;
刷新ok!