Commit 8d3a02a52e87403e3be7491db2bf2ef5d865510f

Authored by 丁强
1 parent f15c216a

修改input组件 autofocus为Boolean值

examples/routers/input-number.vue
1 <template> 1 <template>
2 <div> 2 <div>
3 - <Input-number :max="10" :min="-1" v-model="v1" autofocus></Input-number> 3 + <Input-number :max="10" :min="-1" v-model="v1" :autofocus="autofocus"></Input-number>
4 {{ v1 }} 4 {{ v1 }}
5 <div @click="c">change v1</div> 5 <div @click="c">change v1</div>
6 <Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number> 6 <Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number>
@@ -12,7 +12,8 @@ @@ -12,7 +12,8 @@
12 data () { 12 data () {
13 return { 13 return {
14 v1: 1, 14 v1: 1,
15 - v2: 1 15 + v2: 1,
  16 + autofocus: true
16 }; 17 };
17 }, 18 },
18 computed: {}, 19 computed: {},
examples/routers/input.vue
1 <template> 1 <template>
2 <div style="width: 300px;"> 2 <div style="width: 300px;">
3 - <i-input v-model="value11" icon="ios-clock-outline" autofocus> 3 + <i-input v-model="value11" icon="ios-clock-outline" :autofocus="autofocus">
4 <span slot="prepend">.com</span> 4 <span slot="prepend">.com</span>
5 </i-input> 5 </i-input>
6 <i-input v-model="value11" icon="ios-clock-outline"> 6 <i-input v-model="value11" icon="ios-clock-outline">
@@ -17,7 +17,8 @@ @@ -17,7 +17,8 @@
17 value13: '', 17 value13: '',
18 select1: 'http', 18 select1: 'http',
19 select2: 'com', 19 select2: 'com',
20 - select3: 'day' 20 + select3: 'day',
  21 + autofocus: true
21 } 22 }
22 } 23 }
23 } 24 }
src/components/input-number/input-number.vue
@@ -92,7 +92,8 @@ @@ -92,7 +92,8 @@
92 default: false 92 default: false
93 }, 93 },
94 autofocus: { 94 autofocus: {
95 - type: String 95 + type: Boolean,
  96 + default: false
96 } 97 }
97 }, 98 },
98 data () { 99 data () {
src/components/input/input.vue
@@ -101,7 +101,8 @@ @@ -101,7 +101,8 @@
101 default: false 101 default: false
102 }, 102 },
103 autofocus: { 103 autofocus: {
104 - type: String 104 + type: Boolean,
  105 + default: false
105 } 106 }
106 }, 107 },
107 data () { 108 data () {