fix filed and step

This commit is contained in:
cookfront
2017-03-09 17:32:44 +08:00
parent c17a4261ec
commit 5387aaae29
7 changed files with 118 additions and 14 deletions

View File

@@ -1,3 +1,13 @@
<script>
export default {
data() {
return {
username: 'zhangmin'
};
}
};
</script>
## Field组件
表单中`input``textarea`的输入框。
@@ -9,7 +19,7 @@
:::demo 基础用法
```html
<zan-cell-group>
<zan-field type="text" label="用户名:" placeholder="请输入用户名"></zan-field>
<zan-field type="text" label="用户名:" placeholder="请输入用户名" v-model="username"></zan-field>
<zan-field type="password" label="密码:" placeholder="请输入密码"></zan-field>
<zan-field type="textarea" label="个人介绍:" placeholder="请输入个人介绍"></zan-field>
</zan-cell-group>
@@ -28,14 +38,26 @@
```
:::
### 监听change事件
### 禁用的输入框
监听组件的`change`事件
传入`disabled`属性即可
:::demo 监听change事件
:::demo 禁用的输入框
```html
<zan-cell-group>
<zan-field type="text" label="用户名:" placeholder="请输入用户名" @change="handleChange"></zan-field>
<zan-field label="用户名:" type="text" placeholder="请输入用户名" v-model="username" disabled></zan-field>
</zan-cell-group>
```
:::
### 错误的输入框
传入`error`属性即可。
:::demo 禁用的输入框
```html
<zan-cell-group>
<zan-field label="用户名:" type="text" placeholder="请输入用户名" error></zan-field>
</zan-cell-group>
```
:::
@@ -49,6 +71,7 @@
| value | 输入框的值 | string | '' | |
| label | 输入框标签 | string | '' | |
| disabled | 是否禁用输入框 | boolean | false | |
| error | 输入框是否有错误 | boolean | false | |
| readonly | 输入框是否只读 | boolean | false | |
| maxlength | 输入框maxlength | [String, Number] | '' | |