From c14cb221cdc6ef18b6a242bea1a6b9da366de86e Mon Sep 17 00:00:00 2001 From: baiyaaaaa Date: Sat, 22 Oct 2016 13:01:41 +0800 Subject: [PATCH] fix input native props --- packages/input/src/input.vue | 43 +++++++++++------------------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/packages/input/src/input.vue b/packages/input/src/input.vue index e45cae441..6147fdabf 100644 --- a/packages/input/src/input.vue +++ b/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() {