在main.js中

import {MessageBox } from 'element-ui';
Vue.use(MessageBox );
Vue.prototype.$msgbox = MessageBox;

导致一进入页面,就会出现一个消息弹框

 

原因是:不应该写第二句 Vue.use(MessageBox );正确的写法是,就可以了,使用了use就会默认的执行一次

import {MessageBox } from 'element-ui';

Vue.prototype.$msgbox = MessageBox;

 

 

Copyright © 2024 凡凡0410
Powered by .NET 8.0 on Kubernetes