瀏覽代碼

Input: bind native attrs to input and textarea element (#10382)

杨奕 7 年之前
父節點
當前提交
af4b13d911
共有 1 個文件被更改,包括 2 次插入16 次删除
  1. 2 16
      packages/input/src/input.vue

+ 2 - 16
packages/input/src/input.vue

@@ -23,7 +23,7 @@
         :tabindex="tabindex"
         v-if="type !== 'textarea'"
         class="el-input__inner"
-        v-bind="$props"
+        v-bind="$attrs"
         :disabled="inputDisabled"
         :autocomplete="autoComplete"
         :value="currentValue"
@@ -77,7 +77,7 @@
       :value="currentValue"
       @input="handleInput"
       ref="textarea"
-      v-bind="$props"
+      v-bind="$attrs"
       :disabled="inputDisabled"
       :style="textareaStyle"
       @focus="handleFocus"
@@ -123,16 +123,9 @@
 
     props: {
       value: [String, Number],
-      placeholder: String,
       size: String,
       resize: String,
-      name: String,
       form: String,
-      id: String,
-      maxlength: Number,
-      minlength: Number,
-      readonly: Boolean,
-      autofocus: Boolean,
       disabled: Boolean,
       type: {
         type: String,
@@ -142,17 +135,10 @@
         type: [Boolean, Object],
         default: false
       },
-      rows: {
-        type: Number,
-        default: 2
-      },
       autoComplete: {
         type: String,
         default: 'off'
       },
-      max: {},
-      min: {},
-      step: {},
       validateEvent: {
         type: Boolean,
         default: true