[Improvement] Reorganize document (#1066)

This commit is contained in:
neverland
2018-05-15 10:39:01 +08:00
committed by GitHub
parent b1142fd862
commit e8aad7246c
124 changed files with 181 additions and 186 deletions

60
packages/icon/en-US.md Normal file
View File

@@ -0,0 +1,60 @@
## Icon
### Install
``` javascript
import { Icon } from 'vant';
Vue.use(Icon);
```
### Usage
#### Basic Usage
View all usable icons on the right.
```html
<van-icon name="success" />
```
#### Use local font file
Icon uses font file in `yzcdn.cn` by defaultif you want to use the local font fileplease import the following css file.
```js
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
| Attribute | Description | Type | Default |
|-----------|-----------|-----------|-------------|
| name | Icon name | `String` | `''` |
| info | Info message | `String | Number` | `''` |
| color | Icon color | `String` | `''` | - |
### Event
| Event | Description | Arguments |
|-----------|-----------|-----------|
| click | Triggered when click icon | - |

61
packages/icon/zh-CN.md Normal file
View File

@@ -0,0 +1,61 @@
## Icon 图标
### 使用指南
``` javascript
import { Icon } from 'vant';
Vue.use(Icon);
```
### 代码演示
#### 基础用法
设置`name`属性为对应的图标名称即可,所有可用的图标名称见右侧列表
```html
<van-icon name="success" />
```
#### 使用本地字体文件
Icon 组件默认引用 `yzcdn.cn` 域名下的字体文件,如果想要使用本地字体文件,请引入下面的 css 文件
```js
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
| 参数 | 说明 | 类型 | 默认值 |
|-----------|-----------|-----------|-------------|
| name | 图标名称 | `String` | `''` |
| info | 图标右上角文字提示 | `String | Number` | `''` |
| color | 图标颜色 | `String` | `''` | - |
### Event
| 事件名 | 说明 | 参数 |
|-----------|-----------|-----------|
| click | 点击图标时触发 | - |