在vue3中使用Element

编程入门 行业动态 更新时间:2024-10-27 20:25:10

在vue3中使用<a href=https://www.elefans.com/category/jswz/34/1769660.html style=Element"/>

在vue3中使用Element

首先安装Element-Plus-icon

# 选择一个你喜欢的包管理器# NPM
$ npm install @element-plus/icons-vue
# Yarn
$ yarn add @element-plus/icons-vue
# pnpm
$ pnpm install @element-plus/icons-vue

如何使用

Element-Plus-icon官方文档链接Icon 图标 | Element Plus (element-plus).html#icon-collection

在main.ts中引入Element-Plus-icon

import * as ElementPlusIconsVue from '@element-plus/icons-vue'Object.keys(ElementPlusIconsVue).forEach((key) => {appponent(key, ElementPlusIconsVue[key])
})

第一种直接点击图标复制<el-icon>

                    <el-icon><ArrowRight /></el-icon>

第二种通过icon="el-icon-plus" 

<el-button type="success" icon="el-icon-plus" >1111
</el-button>

第三种通过SVG

<template><div style="font-size: 20px"><!-- 由于SVG图标默认不携带任何属性 --><!-- 你需要直接提供它们 --><Edit style="width: 1em; height: 1em; margin-right: 8px" /><Share style="width: 1em; height: 1em; margin-right: 8px" /><Delete style="width: 1em; height: 1em; margin-right: 8px" /><Search style="width: 1em; height: 1em; margin-right: 8px" /></div>
</template>

更多推荐

在vue3中使用Element

本文发布于:2023-11-15 04:51:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1593973.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Element

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!