mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
Merge branch 'dev' of github.com:youzan/vant into dev
This commit is contained in:
commit
84019a2608
@ -23,6 +23,27 @@ Icon uses font file in `yzcdn.cn` by default,if you want to use the local font
|
|||||||
import 'vant/lib/vant-css/icon-local.css';
|
import 'vant/lib/vant-css/icon-local.css';
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Add custom iconfont
|
||||||
|
|
||||||
|
```css
|
||||||
|
@font-face {
|
||||||
|
font-family: 'custom-iconfont';
|
||||||
|
src: url('./iconfont.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon {
|
||||||
|
font-family: 'vant-icon', 'custom-iconfont' !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon-extra:before {
|
||||||
|
content: '\e626';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-icon name="extra" />
|
||||||
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
| Attribute | Description | Type | Default | Accepted Values |
|
| Attribute | Description | Type | Default | Accepted Values |
|
||||||
|
@ -23,6 +23,27 @@ Icon 组件默认引用 `yzcdn.cn` 域名下的字体文件,如果想要使用
|
|||||||
import 'vant/lib/vant-css/icon-local.css';
|
import 'vant/lib/vant-css/icon-local.css';
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 自定义图标
|
||||||
|
如果需要在现有 Icon 的基础上使用更多图标,可以引入你需要的 iconfont 对应的 ttf 文件和样式,之后就可以在 Icon 组件中直接使用
|
||||||
|
|
||||||
|
```css
|
||||||
|
@font-face {
|
||||||
|
font-family: 'custom-iconfont';
|
||||||
|
src: url('./iconfont.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon {
|
||||||
|
font-family: 'vant-icon', 'custom-iconfont' !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-icon-extra:before {
|
||||||
|
content: '\e626';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-icon name="extra" />
|
||||||
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user