Browse Source

InputNumber: add placeholder attribute (#13275)

SkyAo 6 years ago
parent
commit
bdc9363635

+ 2 - 0
examples/docs/en-US/input-number.md

@@ -191,6 +191,8 @@ Use attribute `size` to set additional sizes with `medium`, `small` or `mini`.
 |controls-position | position of the control buttons | string | right | - |
 |name | same as `name` in native input | string | — | — |
 |label | label text | string | — | — |
+|placeholder | placeholder in input | string | - | - |
+
 ### Events
 
 | Event Name | Description | Parameters |

+ 2 - 0
examples/docs/es/input-number.md

@@ -192,6 +192,8 @@ Utilice el atributo `size` para establecer tamaños adicionales con `medium`, `s
 | controls-position | posición de los botones de control       | string  | right             | -           |
 | name              | lo mismo que `name` en un input nativo   | string  | —                 | —           |
 | label             | texto de la etiqueta                     | string  | —                 | —           |
+| placeholder | placeholder in input | string | - | - |
+
 ### Eventos
 
 | Nombre | Descripción                              | Parámetros         |

+ 2 - 0
examples/docs/zh-CN/input-number.md

@@ -189,6 +189,8 @@
 | controls-position | 控制按钮位置 | string | right | - |
 | name | 原生属性 | string | — | — |
 | label | 输入框关联的label文字 | string | — | — |
+| placeholder | 输入框默认 placeholder | string | - | - |
+
 ### Events
 | 事件名称 | 说明 | 回调参数 |
 |---------|--------|---------|

+ 2 - 0
packages/input-number/src/input-number.vue

@@ -29,6 +29,7 @@
     <el-input
       ref="input"
       :value="currentInputValue"
+      :placeholder="placeholder"
       :disabled="inputNumberDisabled"
       :size="inputNumberSize"
       :max="max"
@@ -91,6 +92,7 @@
       },
       name: String,
       label: String,
+      placeholder: String,
       precision: {
         type: Number,
         validator(val) {