脚本宝典收集整理的这篇文章主要介绍了vue3.0安装Element ui及矢量图使用方式,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
icon在v2中使用的是字体,v3中使用的是svg
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中规定标签的写法,正常编写代码
<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内容请搜索脚本宝典以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本宝典!
以上是脚本宝典为你收集整理的vue3.0安装Element ui及矢量图使用方式全部内容,希望文章能够帮你解决vue3.0安装Element ui及矢量图使用方式所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。