修改input组件 autofocus为Boolean值

This commit is contained in:
丁强 2017-04-28 14:53:17 +08:00
parent f15c216a51
commit 8d3a02a52e
4 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<Input-number :max="10" :min="-1" v-model="v1" autofocus></Input-number> <Input-number :max="10" :min="-1" v-model="v1" :autofocus="autofocus"></Input-number>
{{ v1 }} {{ v1 }}
<div @click="c">change v1</div> <div @click="c">change v1</div>
<Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number> <Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number>
@ -12,7 +12,8 @@
data () { data () {
return { return {
v1: 1, v1: 1,
v2: 1 v2: 1,
autofocus: true
}; };
}, },
computed: {}, computed: {},

View file

@ -1,6 +1,6 @@
<template> <template>
<div style="width: 300px;"> <div style="width: 300px;">
<i-input v-model="value11" icon="ios-clock-outline" autofocus> <i-input v-model="value11" icon="ios-clock-outline" :autofocus="autofocus">
<span slot="prepend">.com</span> <span slot="prepend">.com</span>
</i-input> </i-input>
<i-input v-model="value11" icon="ios-clock-outline"> <i-input v-model="value11" icon="ios-clock-outline">
@ -17,7 +17,8 @@
value13: '', value13: '',
select1: 'http', select1: 'http',
select2: 'com', select2: 'com',
select3: 'day' select3: 'day',
autofocus: true
} }
} }
} }

View file

@ -92,7 +92,8 @@
default: false default: false
}, },
autofocus: { autofocus: {
type: String type: Boolean,
default: false
} }
}, },
data () { data () {

View file

@ -101,7 +101,8 @@
default: false default: false
}, },
autofocus: { autofocus: {
type: String type: Boolean,
default: false
} }
}, },
data () { data () {