Merge pull request #780 from nosixer/2.0

Input 组件增加autofocus属性
This commit is contained in:
Aresn 2017-04-28 14:59:11 +08:00 committed by GitHub
commit 5d5f8dc8c6
4 changed files with 16 additions and 4 deletions

View file

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

View file

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

View file

@ -19,6 +19,7 @@
:class="inputClasses"
:disabled="disabled"
autocomplete="off"
:autofocus="autofocus"
@focus="focus"
@blur="blur"
@keydown.stop="keyDown"
@ -89,6 +90,10 @@
disabled: {
type: Boolean,
default: false
},
autofocus: {
type: Boolean,
default: false
}
},
data () {

View file

@ -16,6 +16,7 @@
:name="name"
:value="currentValue"
:number="number"
:autofocus="autofocus"
@keyup.enter="handleEnter"
@focus="handleFocus"
@blur="handleBlur"
@ -98,6 +99,10 @@
number: {
type: Boolean,
default: false
},
autofocus: {
type: Boolean,
default: false
}
},
data () {