安装和引入方式在Element UI (Vue 2)和Element Plus (Vue 3)中的不同

安装和引入方式

Element UI (Vue 2):

// main.js
import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

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

 

Element Plus (Vue 3):

// main.js
import { createApp } from 'vue';
import App from './App.vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';

const app = createApp(App);
app.use(ElementPlus);
app.mount('#app');

 

posted @ 2024-07-17 11:38  侬侬发  阅读(1)  评论(0编辑  收藏  举报