Browse Source

Chore: update input docs

Leopoldthecoder 7 years ago
parent
commit
bc14458249
2 changed files with 26 additions and 1 deletions
  1. 1 1
      examples/docs/en-US/input.md
  2. 25 0
      examples/docs/zh-CN/input.md

+ 1 - 1
examples/docs/en-US/input.md

@@ -647,6 +647,7 @@ Search data from server-side.
 |maxlength| maximum Input text length| number| — | — |
 |minlength| minimum Input text length| number | — | — |
 |placeholder| placeholder of Input| string | — | — |
+| clearable | whether to show clear button | boolean | — | false |
 |disabled | whether Input is disabled | boolean | — | false |
 |size | size of Input, works when `type` is not 'textarea' | string | medium / small / mini | — |
 | prefix-icon   | prefix icon class  | string          | — | — |
@@ -663,7 +664,6 @@ Search data from server-side.
 |autofocus | same as `autofocus` in native input | boolean | — | false |
 |form | same as `form` in native input | string | — | — |
 | label | label text | string | — | — |
-| clearable | whether to show clear button | boolean | — | false |
 
 ### Input slots
 

+ 25 - 0
examples/docs/zh-CN/input.md

@@ -16,6 +16,7 @@
         input7: '',
         input8: '',
         input9: '',
+        input10: '',
         textarea: '',
         textarea2: '',
         textarea3: '',
@@ -224,6 +225,29 @@ export default {
 ```
 :::
 
+### 可清空
+
+::: demo 使用`clearable`属性即可得到一个可清空的输入框
+
+```html
+<el-input
+  placeholder="请输入内容"
+  v-model="input10"
+  clearable>
+</el-input>
+
+<script>
+  export default {
+    data() {
+      return {
+        input10: ''
+      }
+    }
+  }
+</script>
+```
+:::
+
 ### 带 icon 的输入框
 
 带有图标标记输入类型
@@ -779,6 +803,7 @@ export default {
 | maxlength     | 最大输入长度      | number          |  —  | — |
 | minlength     | 最小输入长度      | number          | — | — |
 | placeholder   | 输入框占位文本    | string          | — | — |
+| clearable     | 是否可清空        | boolean         | — | false |
 | disabled      | 禁用            | boolean         | — | false   |
 | size          | 输入框尺寸,只在 `type!="textarea"` 时有效      | string          | medium / small / mini  | — |
 | prefix-icon   | 输入框头部图标    | string          | — | — |