Skip to content

Icon 图标 ​

图标用于在有限空间内快速传达含义,常出现在按钮、导航与状态提示中。组件基于图标字体渲染,name 指定具体图标,color 控制颜色,颜色可直接引用主题变量,随明暗模式自动适配。

小程序APPWeb
✓✓✓

实例 ​

以下按属性分别说明 mu-icon 的用法,可按需组合。

最简用法只需指定图标名称,名称取自下方的图标列表。

html
<template>
  <mu-icon name="search" />
</template>

颜色 ​

支持主题变量与任意合法颜色,未设置时继承父级文字颜色。

html
<template>
  <mu-icon name="setting" color="var(--mu-color-primary)" />
  <mu-icon name="delete" color="#ff4343" />
</template>

尺寸 ​

传入数字时按像素处理,也可传入带单位的字符串以跟随字号。

html
<template>
  <mu-icon name="setting" :size="24" />
  <mu-icon name="setting" size="1.5em" />
</template>

加粗 ​

开启后以更粗的字重渲染,用于强调或与常规图标区分。

html
<template>
  <mu-icon name="setting" bold />
</template>

图标列表 ​

共 269 个图标,名称为 name 属性的取值。

app-store1alarm-clock1alarm1approve1
archive1asset-monitor1block1bookmark1
camera1audio1bulb1cloud-download1
cloud1calendar1bell1chat1
certificatecalculator1end-date1flag1
cloud-upload1folder-open1file1data-monitor1
building1document-exclamation1hearthome1
collection1Hierarchydislike1drag1
keylike1document1lock1
fire1mobile1folder1expression1
monitor1mail1lightning1mail-open1
location1man1moon1play1
pause1printer1message1rmbbeifen
pad1picture1rmb1phone1
sad1pin1travelstart-date1
relation1templatesetting1unlock1
skin1star1shopping1task1
sound1qr-code1truck1user1
tag1student1time1tool
video-camera1sun1update1umbrella1
webpageWarehousemail-send1a-close-square3
a-close-square2check-circle1close-circle1close-square
stop1exclamation-circle1info-circle1check-square
question-circle1warningdelete1details1
duplicate1ellipsis-circle1edit1a-emptybox
filter1copy1folder-add1table1
folder-move1paste1unlockumbrella
usersuserzoom-inupdate
user-adduploadvideo-cameratruck
zoom-outsynchronizewomanup
app-storea-arrow-rightalarmarrow-down
approvebarsbank-cardbar-chart
asset-monitorarchiveaudioarrow-left
blockbusiness-card-transversealarm-clockcamera
calculatorbuildingcalendarclose-circle
check-circlecheckcloudbookmark
closearrow-upclockcolumn-height
copydirection-leftbulbcloud-download
diagramchatdeletedirection-up
document-exclamationbelldocumentcloud-upload
edita-downupdirection-downdetails
data-monitorexclamation-circleend-dateduplicate
expandcollectiondowndownload
dragellipsis-circledislikedirection-right
equal-proportionfile-txtellipsis-verticaldocument-search
foldereye-invisiblefilterfolder-add
exportforwardflagexpression
eyefilefolder-openhome
folder-movefreeze-columnfullscreenellipsis
firefullscreen-exitimportleft-right
lightninginfo-circlemailmove
menuline-chartlinkmail-send
padmenu-unfoldmanlike
messagemobilemail-openleft
locationpower-offpie-chartprinter
moonresetmenu-foldpaste
locksavephonerelation
minusmonitorpicturesearch
sadrotate-rightquestion-circleshare
minus-squareplus-squareqr-codepause
questionplusplayscissor
rightpinscanshop
shoppingsend-outrotate-leftstop
starsort-ascendingstart-datesound
skinsettingtablermb
studenttimeshrinktime-rewind
sunto-toptagtask
to-bottom

属性 ​

全部属性均可选,未传入时使用默认值;默认值列为 - 表示空字符串。

属性名称说明类型默认值
name图标名称,对应图标字体的 font_class 标识string-
color图标颜色,可使用主题变量或任意合法颜色string-
size图标尺寸,数字按像素处理,也可传入带单位的字符串string | number-
bold是否以更粗的字重渲染图标booleanfalse
customClass自定义类名,附加在图标根节点上以覆盖默认样式string-
customStyle自定义行内样式,直接作用于图标根节点any-

事件 ​

组件支持以下事件。

事件名说明回调参数
click点击图标时触发,可用于处理图标的点击逻辑event: UniEvent