main.js
import { createApp } from ‘vue’
import App from ‘./App.vue’
import ‘./registerServiceWorker’
import router from ‘./router’
import store from ‘./store’
import ElementPlus,{ElLoading} from ‘element-plus’
import ‘element-plus/dist/index.css’
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).mount(‘#app’)
app.config.globalProperties.$ElLoading=ElLoading
window.ElLoading=ElLoading//也可以挂到window对象里面
app.vue
<el-button type=“primary” @click=“overall”> As a service
VUE3全局对象挂载
最新推荐文章于 2024-05-30 14:04:27 发布