Commit 731d69a29a69a249f3e447d805eacdfb413634e4

Authored by 梁灏
1 parent d3dfdb26

fixed #101

Input add name props
Showing 2 changed files with 7 additions and 2 deletions   Show diff stats
src/components/input/input.vue
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 :disabled="disabled" 10 :disabled="disabled"
11 :maxlength="maxlength" 11 :maxlength="maxlength"
12 :readonly="readonly" 12 :readonly="readonly"
  13 + :name="name"
13 v-model="value" 14 v-model="value"
14 @keyup.enter="handleEnter" 15 @keyup.enter="handleEnter"
15 @focus="handleFocus" 16 @focus="handleFocus"
@@ -26,6 +27,7 @@ @@ -26,6 +27,7 @@
26 :rows="rows" 27 :rows="rows"
27 :maxlength="maxlength" 28 :maxlength="maxlength"
28 :readonly="readonly" 29 :readonly="readonly"
  30 + :name="name"
29 v-model="value" 31 v-model="value"
30 @keyup.enter="handleEnter" 32 @keyup.enter="handleEnter"
31 @focus="handleFocus" 33 @focus="handleFocus"
@@ -80,6 +82,9 @@ @@ -80,6 +82,9 @@
80 readonly: { 82 readonly: {
81 type: Boolean, 83 type: Boolean,
82 default: false 84 default: false
  85 + },
  86 + name: {
  87 + type: String
83 } 88 }
84 }, 89 },
85 data () { 90 data () {
test/routers/input.vue
1 <template> 1 <template>
2 - <i-input icon="ios-clock-outline" @on-focus="focus" @on-blur="blur" readonly style="width:200px;" :value.sync="v" @on-enter="enter" @on-click="iconclick" size="large" placeholder="请输入"></i-input> 2 + <i-input name="a" icon="ios-clock-outline" @on-focus="focus" @on-blur="blur" readonly style="width:200px;" :value.sync="v" @on-enter="enter" @on-click="iconclick" size="large" placeholder="请输入"></i-input>
3 <i-input icon="ios-clock-outline" style="width:200px;" :value.sync="v" @on-enter="enter" placeholder="请输入"></i-input> 3 <i-input icon="ios-clock-outline" style="width:200px;" :value.sync="v" @on-enter="enter" placeholder="请输入"></i-input>
4 - <i-input icon="ios-clock-outline" style="width:200px;" :value.sync="v" @on-enter="enter" size="small" placeholder="请输入"></i-input> 4 + <i-input name="b" icon="ios-clock-outline" style="width:200px;" :value.sync="v" @on-enter="enter" size="small" placeholder="请输入"></i-input>
5 <br> 5 <br>
6 <br> 6 <br>
7 <i-input style="width:200px;" :value.sync="v" @on-enter="enter" size="large" placeholder="请输入"></i-input> 7 <i-input style="width:200px;" :value.sync="v" @on-enter="enter" size="large" placeholder="请输入"></i-input>