• 在Vue3中使用Element Plus Icon图标的几种方式


    安装 Element Plus

    $ npm install @element-plus/icons
    

    在main.js 引入

    1. import * as ElIcon from '@element-plus/icons-vue'
    2. Object.keys(ElIcon).forEach((key) => {
    3. app.component(key, ElIcon[key])
    4. })

    方式一:通过  icon="el-icon-plus" 使用 

      

    1. <el-button type="success" icon="el-icon-plus" >
    2. 新建规则
    3. el-button>

    方式二:通过   使用  

    1. <el-button type="success">
    2. <el-icon style="vertical-align: middle">
    3. <Plus />
    4. el-icon>
    5. <span style="vertical-align: middle">新建规则span>
    6. el-button>

    方式三:通过   直接使用  SVG 图标

    1. <el-button type="success">
    2. <Plus style="width: 1em; height: 1em; margin-right: 8px"/>
    3. <span style="vertical-align: middle">新建规则span>
    4. el-button>

    附:Element Plus Icon图标 名称

    System 

    • Plus
    • Minus
    • CirclePlus
    • Search
    • Female
    • Male
    • Aim
    • House
    • FullScreen
    • Loading
    • Link
    • Service
    • Pointer
    • Star
    • Notification
    • Connection
    • ChatDotRound
    • Setting
    • Clock
    • Position
    • Discount
    • Odometer
    • ChatSquare
    • ChatRound
    • ChatLineRound
    • ChatLineSquare
    • ChatDotSquare
    • View
    • Hide
    • Unlock
    • Lock
    • RefreshRight
    • RefreshLeft
    • Refresh
    • Bell
    • MuteNotification
    • User
    • Check
    • CircleCheck
    • Warning
    • CircleClose
    • Close
    • PieChart
    • More
    • Compass
    • Filter
    • Switch
    • Select
    • SemiSelect
    • CloseBold
    • EditPen
    • Edit
    • Message
    • MessageBox
    • TurnOff
    • Finished
    • Delete
    • Crop
    • SwitchButton
    • Operation
    • Open
    • Remove
    • ZoomOut
    • ZoomIn
    • InfoFilled
    • CircleCheckFilled
    • SuccessFilled
    • WarningFilled
    • CircleCloseFilled
    • QuestionFilled
    • WarnTriangleFilled
    • UserFilled
    • MoreFilled
    • Tools
    • HomeFilled
    • Menu
    • UploadFilled
    • Avatar
    • HelpFilled
    • Share
    • StarFilled
    • Comment
    • Histogram
    • Grid
    • Promotion
    • DeleteFilled
    • RemoveFilled
    • CirclePlusFilled

    Arrow

    • ArrowLeft
    • ArrowUp
    • ArrowRight
    • ArrowDown
    • ArrowLeftBold
    • ArrowUpBold
    • ArrowRightBold
    • ArrowDownBold
    • DArrowRight
    • DArrowLeft
    • Download
    • Upload
    • Top
    • Bottom
    • Back
    • Right
    • TopRight
    • TopLeft
    • BottomRight
    • BottomLeft
    • Sort
    • SortUp
    • SortDown
    • Rank
    • CaretLeft
    • CaretTop
    • CaretRight
    • CaretBottom
    • DCaret
    • Expand
    • Fold

    Document

    • DocumentAdd
    • Document
    • Notebook
    • Tickets
    • Memo
    • Collection
    • Postcard
    • ScaleToOriginal
    • SetUp
    • DocumentDelete
    • DocumentChecked
    • DataBoard
    • DataAnalysis
    • CopyDocument
    • FolderChecked
    • Files
    • Folder
    • FolderDelete
    • FolderRemove
    • FolderOpened
    • DocumentCopy
    • DocumentRemove
    • FolderAdd
    • FirstAidKit
    • Reading
    • DataLine
    • Management
    • Checked
    • Ticket
    • Failed
    • TrendCharts
    • List

    Media

    • Microphone
    • Mute
    • Mic
    • VideoPause
    • VideoCamera
    • VideoPlay
    • Headset
    • Monitor
    • Film
    • Camera
    • Picture
    • PictureRounded
    • Iphone
    • Cellphone
    • VideoCameraFilled
    • PictureFilled
    • Platform
    • CameraFilled
    • BellFilled

    Traffic

    • Location
    • LocationInformation
    • DeleteLocation
    • Coordinate
    • Bicycle
    • OfficeBuilding
    • School
    • Guide
    • AddLocation
    • MapLocation
    • Place
    • LocationFilled
    • Van

    Food

    • Watermelon
    • Pear
    • NoSmoking
    • Smoking
    • Mug
    • GobletSquareFull
    • GobletFull
    • KnifeFork
    • Sugar
    • Bowl
    • MilkTea
    • Lollipop
    • Coffee
    • Chicken
    • Dish
    • IceTea
    • ColdDrink
    • CoffeeCup
    • DishDot
    • IceDrink
    • IceCream
    • Dessert
    • IceCreamSquare
    • ForkSpoon
    • IceCreamRound
    • Food
    • HotWater
    • Grape
    • Fries
    • Apple
    • Burger
    • Goblet
    • GobletSquare
    • Orange
    • Cherry

    Items

    • Printer
    • Calendar
    • CreditCard
    • Box
    • Money
    • Refrigerator
    • Cpu
    • Football
    • Brush
    • Suitcase
    • SuitcaseLine
    • Umbrella
    • AlarmClock
    • Medal
    • GoldMedal
    • Present
    • Mouse
    • Watch
    • QuartzWatch
    • Magnet
    • Help
    • Soccer
    • ToiletPaper
    • ReadingLamp
    • Paperclip
    • MagicStick
    • Basketball
    • Baseball
    • Coin
    • Goods
    • Sell
    • SoldOut
    • Key
    • ShoppingCart
    • ShoppingCartFull
    • ShoppingTrolley
    • Phone
    • Scissor
    • Handbag
    • ShoppingBag
    • Trophy
    • TrophyBase
    • Stopwatch
    • Timer
    • CollectionTag
    • TakeawayBox
    • PriceTag
    • Wallet
    • Opportunity
    • PhoneFilled
    • WalletFilled
    • GoodsFilled
    • Flag
    • BrushFilled
    • Briefcase
    • Stamp

    Weather

    • Sunrise
    • Sunny
    • Ship
    • MostlyCloudy
    • PartlyCloudy
    • Sunset
    • Drizzling
    • Pouring
    • Cloudy
    • Moon
    • MoonNight
    • Lightning

    Other

    • ChromeFilled
    • Eleme
    • ElemeFilled
    • ElementPlus
    • Shop
    • SwitchFilled
    • WindPower
  • 相关阅读:
    Redis之实现优惠券高并发秒杀下单
    Docker的常用命令
    基于python的民宿旅馆消费数据分析系统
    sql聚合函数嵌套问题 aggregate function cannot contain aggregate parameters
    如何在Nginx上启用HTTPS
    uni-app Android studio 本地打包 【图文讲解】
    2021-06-09 51单片机:两个独立按键控制一个led,k1按下松开led闪烁三次,k2按下LED闪烁五次
    杰理之内置关机电流 1.2uA,之后不能长按开机【篇】
    sql中的排序函数dense_rank(),RANK()和row_number()
    多线程抽象知识汇总
  • 原文地址:https://blog.csdn.net/admans/article/details/128032155