main.js之前的写法

import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store'

import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';

Vue.use(ElementUI);
new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')

新的写法

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import 'element-plus/lib/theme-chalk/index.css';
import ElementPlus from 'element-plus';

const app = createApp(App)
app.use(ElementPlus)
app.use(store).use(router).mount('#app')
Logo

前往低代码交流专区

更多推荐