docs: add docs
This commit is contained in:
parent
bac868d071
commit
2fcfd6b4d1
40
docs/使用图标.md
Normal file
40
docs/使用图标.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
## 使用 iconify 图标
|
||||||
|
|
||||||
|
首先去图标库地址:[icones](https://icones.js.org/) 找合适的图标
|
||||||
|
|
||||||
|
### 1. 结合 unocss 使用
|
||||||
|
|
||||||
|
```html
|
||||||
|
<i i-carbon-sun />
|
||||||
|
<i class="i-carbon-sun" />
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 结合插件 unplugin-icons 自定义标签使用
|
||||||
|
|
||||||
|
`<icon-[iconify图标名称]`
|
||||||
|
|
||||||
|
```html
|
||||||
|
<icon-ant-design:fullscreen-exit-outlined />
|
||||||
|
<icon-ant-design:fullscreen-outlined />
|
||||||
|
```
|
||||||
|
|
||||||
|
这种方式还支持自定义 svg 图标,本项目自定义 svg 图标固定放在 src/assets/svg 下
|
||||||
|
|
||||||
|
`<icon-custom-[svg图标文件名]`
|
||||||
|
|
||||||
|
```
|
||||||
|
<icon-custom-logo />
|
||||||
|
```
|
||||||
|
|
||||||
|
具体配置参看 build/plugin/unplugin.js
|
||||||
|
|
||||||
|
### 3. 结合 Naive UI 的 NIcon 组件封装使用
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- iconify图标 -->
|
||||||
|
<TheIcon icon="material-symbols:delete-outline" />
|
||||||
|
<!-- 自定义svg图标 -->
|
||||||
|
<TheIcon icon="logo" type="custom" />
|
||||||
|
```
|
||||||
|
|
||||||
|
封装组件参看 src/components/icon
|
Loading…
x
Reference in New Issue
Block a user