element-plus時為vue.js?3開發的組件庫。
在引入前需要做如下準備
安裝node.js
https://blog.csdn.net/zlpzlpzyd/article/details/147704723
安裝vue的腳手架vue-cli
https://blog.csdn.net/zlpzlpzyd/article/details/149647351
安裝element-plus
github地址
https://github.com/element-plus/element-plus
官網介紹
https://element-plus.org/zh-CN/component/overview.html
全局引入element-plus組件庫和樣式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
引入css重置工具包,由于不同瀏覽器的css支持不同,此css可以確保不同瀏覽器展示效果一致
npm install normalize.css
element-plus字體圖標庫
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {app.component(key, component);
}