浏览代码

add name prop to form components (#6042)

add name prop

Revert "feature menu collapse"

This reverts commit e5ef11d87825f02357c434aedfcef79192600b1b.
baiyaaaaa 8 年之前
父节点
当前提交
258a165416

+ 1 - 0
examples/docs/en-US/date-picker.md

@@ -287,6 +287,7 @@ Picking a date range is supported.
 | picker-options | additional options, check the table below | object | — | {} |
 | picker-options | additional options, check the table below | object | — | {} |
 | range-separator | range separator | string | - | ' - ' |
 | range-separator | range separator | string | - | ' - ' |
 | default-value | optional default time of the picker | Date | anything accepted by `new Date()` | - |
 | default-value | optional default time of the picker | Date | anything accepted by `new Date()` | - |
+|name | same as `name` in native input | string | — | — |
 
 
 ### Picker Options
 ### Picker Options
 | Attribute      | Description          | Type      | Accepted Values       | Default  |
 | Attribute      | Description          | Type      | Accepted Values       | Default  |

+ 1 - 0
examples/docs/en-US/datetime-picker.md

@@ -241,6 +241,7 @@ Select date and time in one picker.
 | popper-class | custom class name for DateTimePicker's dropdown | string | — | — |
 | popper-class | custom class name for DateTimePicker's dropdown | string | — | — |
 | picker-options | additional options, check the table below | object | — | {} |
 | picker-options | additional options, check the table below | object | — | {} |
 | range-separator | range separator | string | - | ' - ' |
 | range-separator | range separator | string | - | ' - ' |
+|name | same as `name` in native input | string | — | — |
 
 
 ### Picker Options
 ### Picker Options
 | Attribute      | Description          | Type      | Accepted Values       | Default  |
 | Attribute      | Description          | Type      | Accepted Values       | Default  |

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

@@ -135,6 +135,7 @@ Additional `large` and `small` sizes of the input box are available
 |disabled| whether the component is disabled | boolean | — | false |
 |disabled| whether the component is disabled | boolean | — | false |
 |controls| whether to enable the control buttons | boolean | — | true |
 |controls| whether to enable the control buttons | boolean | — | true |
 |debounce| debounce delay when typing, in millisecond | number | — | 300 |
 |debounce| debounce delay when typing, in millisecond | number | — | 300 |
+|name | same as `name` in native input | string | — | — |
 
 
 ### Events
 ### Events
 
 

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

@@ -640,6 +640,7 @@ Attribute | Description | Type | Options | Default
 | popper-class | custom class name for autocomplete's dropdown | string | — | — |
 | popper-class | custom class name for autocomplete's dropdown | string | — | — |
 | trigger-on-focus | whether show suggestions when input focus | boolean | — | true |
 | trigger-on-focus | whether show suggestions when input focus | boolean | — | true |
 | on-icon-click | hook function when clicking on the input icon | function | — | — |
 | on-icon-click | hook function when clicking on the input icon | function | — | — |
+|name | same as `name` in native input | string | — | — |
 
 
 ### props
 ### props
 | Attribute | Description | Type | Accepted Values | Default |
 | Attribute | Description | Type | Accepted Values | Default |

+ 1 - 0
examples/docs/en-US/time-picker.md

@@ -161,6 +161,7 @@ Can pick an arbitrary time range.
 | align | alignment | left/center/right | left |
 | align | alignment | left/center/right | left |
 | popper-class | custom class name for TimePicker's dropdown | string | — | — |
 | popper-class | custom class name for TimePicker's dropdown | string | — | — |
 | picker-options | additional options, check the table below | object | — | {} |
 | picker-options | additional options, check the table below | object | — | {} |
+|name | same as `name` in native input | string | — | — |
 
 
 ### Time Select Options
 ### Time Select Options
 | Attribute      | Description          | Type      | Accepted Values       | Default  |
 | Attribute      | Description          | Type      | Accepted Values       | Default  |

+ 1 - 0
examples/docs/zh-CN/date-picker.md

@@ -297,6 +297,7 @@
 |picker-options | 当前时间日期选择器特有的选项参考下表 | object |  — | {} |
 |picker-options | 当前时间日期选择器特有的选项参考下表 | object |  — | {} |
 | range-separator | 选择范围时的分隔符 | string | - | ' - ' |
 | range-separator | 选择范围时的分隔符 | string | - | ' - ' |
 | default-value | 可选,DatePicker打开时默认显示的时间 | Date | 可被new Date()解析 | - |
 | default-value | 可选,DatePicker打开时默认显示的时间 | Date | 可被new Date()解析 | - |
+| name | 原生属性 | string | — | — |
 
 
 ### Picker Options
 ### Picker Options
 | 参数      | 说明          | 类型      | 可选值                           | 默认值  |
 | 参数      | 说明          | 类型      | 可选值                           | 默认值  |

+ 1 - 0
examples/docs/zh-CN/datetime-picker.md

@@ -240,6 +240,7 @@
 | popper-class | DateTimePicker 下拉框的类名 | string | — | — |
 | popper-class | DateTimePicker 下拉框的类名 | string | — | — |
 | picker-options | 当前时间日期选择器特有的选项参考下表 | object |  — | {} |
 | picker-options | 当前时间日期选择器特有的选项参考下表 | object |  — | {} |
 | range-separator | 选择范围时的分隔符 | string | - | ' - ' |
 | range-separator | 选择范围时的分隔符 | string | - | ' - ' |
+| name | 原生属性 | string | — | — |
 
 
 ### Picker Options
 ### Picker Options
 | 参数      | 说明          | 类型      | 可选值                           | 默认值  |
 | 参数      | 说明          | 类型      | 可选值                           | 默认值  |

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

@@ -132,6 +132,7 @@
 | disabled | 是否禁用计数器        | boolean | — | false |
 | disabled | 是否禁用计数器        | boolean | — | false |
 | controls | 是否使用控制按钮        | boolean | — | true |
 | controls | 是否使用控制按钮        | boolean | — | true |
 | debounce | 输入时的去抖延迟,毫秒 | number | — | 300 |
 | debounce | 输入时的去抖延迟,毫秒 | number | — | 300 |
+| name | 原生属性 | string | — | — |
 
 
 ### Events
 ### Events
 | 事件名称 | 说明 | 回调参数 |
 | 事件名称 | 说明 | 回调参数 |

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

@@ -801,6 +801,7 @@ export default {
 | trigger-on-focus | 是否在输入框 focus 时显示建议列表 | boolean | — | true |
 | trigger-on-focus | 是否在输入框 focus 时显示建议列表 | boolean | — | true |
 | on-icon-click | 点击图标的回调函数 | function | — | — |
 | on-icon-click | 点击图标的回调函数 | function | — | — |
 | icon          | 输入框尾部图标    | string          | — | — |
 | icon          | 输入框尾部图标    | string          | — | — |
+| name | 原生属性 | string | — | — |
 
 
 ### Props
 ### Props
 | 参数     | 说明              | 类型   | 可选值 | 默认值 |
 | 参数     | 说明              | 类型   | 可选值 | 默认值 |

+ 1 - 0
examples/docs/zh-CN/time-picker.md

@@ -160,6 +160,7 @@
 | align | 对齐方式 | string | left, center, right | left |
 | align | 对齐方式 | string | left, center, right | left |
 | popper-class | TimePicker 下拉框的类名 | string | — | — |
 | popper-class | TimePicker 下拉框的类名 | string | — | — |
 | picker-options | 当前时间日期选择器特有的选项参考下表 | object | — | {} |
 | picker-options | 当前时间日期选择器特有的选项参考下表 | object | — | {} |
+| name | 原生属性 | string | — | — |
 
 
 ### Time Select Options
 ### Time Select Options
 | 参数      | 说明          | 类型      | 可选值                           | 默认值  |
 | 参数      | 说明          | 类型      | 可选值                           | 默认值  |

+ 2 - 0
packages/date-picker/src/picker.vue

@@ -5,6 +5,7 @@
     :readonly="!editable || readonly"
     :readonly="!editable || readonly"
     :disabled="disabled"
     :disabled="disabled"
     :size="size"
     :size="size"
+    :name="name"
     v-clickoutside="handleClose"
     v-clickoutside="handleClose"
     :placeholder="placeholder"
     :placeholder="placeholder"
     @focus="handleFocus"
     @focus="handleFocus"
@@ -205,6 +206,7 @@ export default {
     format: String,
     format: String,
     readonly: Boolean,
     readonly: Boolean,
     placeholder: String,
     placeholder: String,
+    name: String,
     disabled: Boolean,
     disabled: Boolean,
     clearable: {
     clearable: {
       type: Boolean,
       type: Boolean,

+ 9 - 7
packages/input-number/src/input-number.vue

@@ -33,14 +33,15 @@
       :size="size"
       :size="size"
       :max="max"
       :max="max"
       :min="min"
       :min="min"
+      :name="name"
       ref="input"
       ref="input"
     >
     >
-        <template slot="prepend" v-if="$slots.prepend">
-          <slot name="prepend"></slot>
-        </template>
-        <template slot="append" v-if="$slots.append">
-          <slot name="append"></slot>
-        </template> 
+      <template slot="prepend" v-if="$slots.prepend">
+        <slot name="prepend"></slot>
+      </template>
+      <template slot="append" v-if="$slots.append">
+        <slot name="append"></slot>
+      </template> 
     </el-input>
     </el-input>
   </div>
   </div>
 </template>
 </template>
@@ -104,7 +105,8 @@
       debounce: {
       debounce: {
         type: Number,
         type: Number,
         default: 300
         default: 300
-      }
+      },
+      name: String
     },
     },
     data() {
     data() {
       return {
       return {