Browse Source

Merge pull request #585 from baiyaaaaa/feat-input

fix input native props
baiyaaaaa 8 years ago
parent
commit
7192d8603c
1 changed files with 13 additions and 30 deletions
  1. 13 30
      packages/input/src/input.vue

+ 13 - 30
packages/input/src/input.vue

@@ -22,10 +22,11 @@
         :placeholder="placeholder"
         :disabled="disabled"
         :readonly="readonly"
-        :number="number"
         :maxlength="maxlength"
         :minlength="minlength"
         :autocomplete="autoComplete"
+        :autofocus="autofocus"
+        :form="form"
         :value="value"
         ref="input"
         @input="handleInput"
@@ -49,6 +50,8 @@
       :style="textareaStyle"
       :readonly="readonly"
       :rows="rows"
+      :form="form"
+      :autofocus="autofocus"
       :maxlength="maxlength"
       :minlength="minlength"
       @focus="handleFocus"
@@ -67,38 +70,17 @@
 
     props: {
       value: [String, Number],
-      placeholder: {
-        type: String,
-        default: ''
-      },
-      size: {
-        type: String,
-        default: ''
-      },
-      readonly: {
-        type: Boolean,
-        default: false
-      },
-      icon: {
-        type: String,
-        default: ''
-      },
-      disabled: {
-        type: Boolean,
-        default: false
-      },
+      placeholder: String,
+      size: String,
+      readonly: Boolean,
+      autofocus: Boolean,
+      icon: String,
+      disabled: Boolean,
       type: {
         type: String,
         default: 'text'
       },
-      name: {
-        type: String,
-        default: ''
-      },
-      number: {
-        type: Boolean,
-        default: false
-      },
+      name: String,
       autosize: {
         type: [Boolean, Object],
         default: false
@@ -111,13 +93,14 @@
         type: String,
         default: 'off'
       },
+      form: String,
       maxlength: Number,
       minlength: Number
     },
 
     methods: {
       handleBlur(event) {
-        this.$emit('onblur', this.currentValue);
+        this.$emit('blur', this.currentValue);
         this.dispatch('form-item', 'el.form.blur', [this.currentValue]);
       },
       inputSelect() {