Icon 图标

WinDesign Next 提供了一套常用的图标集合。

使用图标

  • 如果你想像用例一样直接使用,你需要全局注册组件,才能够直接在项目里使用。

安装

使用包管理器

shell
$ npm install @win-design-next/icons-vue --registry http://172.16.9.57:8081/repository/npm-group/ --save
shell
$ yarn add @win-design-next/icons-vue --registry http://172.16.9.57:8081/repository/npm-group/ --save
shell
$ pnpm install @win-design-next/icons-vue --registry http://172.16.9.57:8081/repository/npm-group/ --save

注册所有图标

您需要从 @win-design-next/icons-vue 中导入所有图标并进行全局注册。

ts
// main.ts

import * as WinDesignNextIconsVue from '@win-design-next/icons-vue'

const app = createApp(App)
for (const [key, component] of Object.entries(WinDesignNextIconsVue)) {
  app.component(key, component)
}

自动导入

使用 unplugin-iconsunplugin-auto-import 从 iconify 中自动导入任何图标集。

基础用法

vue
<!-- 使用 w-icon 为 SVG 图标提供属性 -->
<template>
  <div>
    <w-icon :size="size" :color="color">
      <Search />
    </w-icon>
    <!-- 或者独立使用它,不从父级获取属性 -->
    <Search />
  </div>
</template>

结合 w-icon 使用

w-icon 为 raw SVG 图标提供额外的属性, 提供的详细属性请继续阅读。

vue
<template>
  <w-icon :size="20" color="#409efc" class="no-inherit">
    <Search />
  </w-icon>
  <w-icon class="is-loading">
    <Loading />
  </w-icon>
  <w-icon>
    <Search />
  </w-icon>
  <w-button type="primary">
    <w-icon style="vertical-align: middle">
      <Search />
    </w-icon>
    <span style="vertical-align: middle"> Search </span>
  </w-button>
</template>

通过添加额外的类名 is-loading,你的图标就可以在 2 秒内旋转 360 度,当然你也可以自己改写想要的动画。

直接使用 SVG 图标

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

图标集合

TIP

只要你安装了 @win-design-next/icons-vue,就可以在任意版本里使用 SVG 图标

您可以点击图标复制代码。

Copy icon code
通用
  • Home
  • Search
  • Edit
  • Delete
  • Copy
  • Cut
  • Paste
  • Drag
  • Enter
  • Setting
  • SettingFilled
  • Download
  • Date
  • Time
  • User
  • CircleLoading
  • Loading
  • Others
  • OthersFilled
  • OthersVertical
  • Code
  • Fullscreen
  • FullscreenExit
  • Filter
  • Refresh
  • RefreshRight
  • RefreshLeft
  • Reply
  • Repost
  • Skin
  • Star
  • StarFilled
业务
  • BedsideCard
  • Freeze
  • Defrost
方向
  • CaretLeft
  • CaretRight
  • CaretTop
  • CaretBottom
  • ArrowLeft
  • ArrowUp
  • ArrowRight
  • ArrowDown
  • DArrowLeft
  • DArrowBottom
  • DArrowRight
  • DArrowTop
  • ArrowBottomCircle
  • ArrowTopCircle
  • ArrowLeftCircle
  • ArrowRightCircle
  • ArrowBottomSolid
  • ArrowTopSolid
  • ArrowLeftSolid
  • ArrowRightSolid
  • ArrowLeftRight
  • ArrowTopBottom
  • CircleLeft
  • CircleRight
  • CircleTop
  • CircleBottom
  • Back
  • Bottom
  • Top
  • Right
  • BottomLeft
  • BottomRight
  • TopLeft
  • TopRight
  • Decrease
  • Increase
  • DirectionRight
  • DirectionLeft
  • RightSolid
  • LeftSolid
  • BottomSolid
  • TopSolid
  • DCaret
  • MoveDown
  • MoveUp
  • Sort
  • SortDown
  • SortUp
  • Swap
  • SwapLeft
  • SwapRight
  • Stretch
  • Shrink
  • AtBottom
  • BackTop
状态
  • Check
  • CircleCheck
  • CircleSuccessFilled
  • Plus
  • CirclePlus
  • CirclePlusFilled
  • Minus
  • CircleMinus
  • CircleMinusFilled
  • Close
  • CircleClose
  • CircleCloseFilled
  • Qmark
  • CircleQmark
  • CircleQmarkFilled
  • Info
  • CircleInfo
  • CircleInfoFilled
  • Warning
  • CircleWarning
  • CircleErrorFilled
  • CircleWarningFilled
  • WarningTriangle
文档
  • Unfold
  • Fold
  • List
  • ListSolid
  • ListTimeline
  • ListTree
  • File
  • Excel
  • Folder
  • FolderO
  • Pdf
  • Picture
  • Ppt
  • Word
  • ShareFold
  • Text
  • Template
  • Qrcode
图表
  • BarChart
  • LineChart
  • PieChart
媒体
  • Bell
  • Computer
  • Mobile
  • PauseCircle
  • Play
  • Voice
  • VoiceOff
  • Video
  • TurnOff
  • Volume
  • Stop
  • NotificationClose
  • Telephone
系统
  • Database
  • DatabaseException
Other
  • Atlas
  • Attach
  • Bad
  • Barcode
  • Batch
  • BatchPrintSettings
  • Branch
  • ClickOn
  • CloseLoop
  • Cloud
  • CloudDownload
  • Control
  • Element
  • EqualRatioSquare
  • Export
  • Female
  • Fixed
  • Flag
  • Flow
  • ForbidLeft
  • ForbidRight
  • Good
  • Guide
  • HistoryLeft
  • HistoryRight
  • Hospital
  • Hourglass
  • Key
  • Layout
  • Like
  • Link
  • Location
  • Lock
  • Male
  • Man
  • MaximizeSquare
  • Node
  • Portfolio
  • Preview
  • Print
  • Property
  • Quit
  • Rank
  • Recover
  • Remarks
  • RestoreSquare
  • Save
  • Scan
  • Send
  • SendFilled
  • Server
  • Share
  • Signature
  • Stamp
  • Talk
  • Theme
  • Tool
  • Undo
  • Unknown
  • Unlink
  • Unlock
  • Upload
  • UserGroup
  • Verify
  • ViewGridCard
  • ViewGridDetail
  • ViewGridList
  • ViewOff
  • ViewSolid
  • Woman
  • ZoomIn
  • ZoomOut

API

Attributes

属性名说明类型默认值
colorsvg 的 fill 颜色string继承颜色
sizeSVG 图标的大小,size x sizenumber / string继承字体大小

Slots

名称说明
default自定义默认内容

Copyright 2025 Winning Health 版权所有