vue3.x 关于引入第三方组件报错
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-u
·
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')
更多推荐
已为社区贡献1条内容
所有评论(0)