[Doc] new theme

This commit is contained in:
陈嘉涵
2019-05-15 20:53:04 +08:00
parent 3cae4288f2
commit d0f4169c86
130 changed files with 1460 additions and 1147 deletions
+16 -8
View File
@@ -1,15 +1,17 @@
## Field
# Field
### Install
``` javascript
import { Field } from 'vant';
Vue.use(Field);
```
### Usage
## Usage
### Basic Usage
#### Basic Usage
The value of field is bound with v-model.
```html
@@ -18,7 +20,8 @@ The value of field is bound with v-model.
</van-cell-group>
```
#### Custom type
### Custom type
Use `type` prop to custom diffrent type fields.
```html
@@ -43,7 +46,7 @@ Use `type` prop to custom diffrent type fields.
</van-cell-group>
```
#### Disabled
### Disabled
```html
<van-cell-group>
@@ -56,7 +59,8 @@ Use `type` prop to custom diffrent type fields.
</van-cell-group>
```
#### Error info
### Error info
Use `error` or `error-message` to show error info
```html
@@ -76,7 +80,8 @@ Use `error` or `error-message` to show error info
</van-cell-group>
```
#### Auto resize
### Auto resize
Textarea Field can be auto resize when has `autosize` prop
```html
@@ -92,7 +97,8 @@ Textarea Field can be auto resize when has `autosize` prop
</van-cell-group>
```
#### Insert button
### Insert button
Use button slot to insert button
```html
@@ -109,6 +115,8 @@ Use button slot to insert button
</van-cell-group>
```
## API
### Props
Field support all native properties of input tagsuch as `maxlength`、`placeholder`、`autofocus`
+14 -10
View File
@@ -1,17 +1,19 @@
## Field 输入框
# Field 输入框
`input``textarea`的输入框。
### 介绍
### 使用指南
表单中的输入框组件,支持`input``textarea`两种类型
### 引入
``` javascript
import { Field } from 'vant';
Vue.use(Field);
```
### 代码演示
## 代码演示
#### 基础用法
### 基础用法
通过 v-model 绑定输入框的值
@@ -21,7 +23,7 @@ Vue.use(Field);
</van-cell-group>
```
#### 自定义类型
### 自定义类型
根据`type`属性定义不同类型的输入框
@@ -47,7 +49,7 @@ Vue.use(Field);
</van-cell-group>
```
#### 禁用输入框
### 禁用输入框
```html
<van-cell-group>
@@ -60,7 +62,7 @@ Vue.use(Field);
</van-cell-group>
```
#### 错误提示
### 错误提示
通过`error`或者`error-message`属性增加对应的错误提示
@@ -81,7 +83,7 @@ Vue.use(Field);
</van-cell-group>
```
#### 高度自适应
### 高度自适应
对于 textarea,可以通过`autosize`属性设置高度自适应
@@ -98,7 +100,7 @@ Vue.use(Field);
</van-cell-group>
```
#### 插入按钮
### 插入按钮
通过 button 插槽可以在输入框尾部插入按钮
@@ -116,6 +118,8 @@ Vue.use(Field);
</van-cell-group>
```
## API
### Props
Field 默认支持 Input 标签所有的原生属性,比如 `maxlength`、`placeholder`、`autofocus` 等