vue3.0安裝Element?ui及矢量圖使用方式
- 在此只關注v3的安裝及使用,如果想了解v2可移步到其官網:https://element.eleme.io/#/zh-CN/component/installation
- v3官網:https://element-plus.org/zh-CN/guide/installation.html
- 使用element ui時vue2和vue3的區(qū)別
- 安裝命令
icon在v2中使用的是字體,v3中使用的是svg
安裝Element ui
- 使用npm安裝
npm install element-plus --save
icon圖標需安裝
npm install @element-plus/icons-vue
- 使用
在main.js中全局轉入
import elementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/assets/css/index.scss'
//引入外部矢量圖
import '@/assets/iconfont/iconfont.css'
const app = createApp(App);
app.config.globalProperties.axios = axios;
app
.use(elementPlus)
.mount('#app');
按照Element ui中規(guī)定標簽的寫法,正常編寫代碼
vue文件使用icon圖標
<el-icon :size="size" :color="color"> <edit></edit> </el-icon>
或
<edit></edit>
<add-location/>
//矢量圖
<i class="iconfont icon-huyan"></i>
//引入需要使用的icon(svg)
import {Edit,AddLocation} from '@element-plus/icons-vue'
components:{ Edit, AddLocation }
項目中引入矢量圖
下載


- 使用
將這六個文件拷貝到項目中,在main.js中引入后再進行使用

到此這篇關于vue3.0安裝Element ui及矢量圖使用的文章就介紹到這了,更多相關vue3.0安裝Element ui內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
vue恢復初始數據this.$data,this.$options.data()解析
這篇文章主要介紹了vue恢復初始數據this.$data,this.$options.data()解析,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-03-03
vue2.0 獲取從http接口中獲取數據,組件開發(fā),路由配置方式
今天小編就為大家分享一篇vue2.0 獲取從http接口中獲取數據,組件開發(fā),路由配置方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-11-11

