Vue3.0如何设置全局组件并使用实例对象
在main.js 注册全局组件(prototype)可以访问的属性vue2.0Vue.prototype.$Msg = (info, msgType) => { ElMessage ({ message: info, type: msgType, customClass: 'm-z-index' })}vue3.0const app = createApp(App)app.config.globalProperties.$Msg = (info, msgType) => {
原创
2021-05-07 16:15:23 ·
1166 阅读 ·
0 评论