fix: time-picker focus blur autoFocus not work

pull/165/head
tjz 2018-06-17 15:56:12 +08:00
parent 92c8a05a49
commit d0d5552f50
2 changed files with 11 additions and 0 deletions

View File

@ -55,6 +55,8 @@ export const TimePickerProps = () => ({
align: PropTypes.object,
placement: PropTypes.any,
transitionName: PropTypes.string,
autoFocus: PropTypes.bool,
addon: PropTypes.any,
})
export default {
@ -146,6 +148,7 @@ export default {
class: className,
ref: 'timePicker',
on: {
...this.$listeners,
change: this.handleChange,
open: this.handleOpenClose,
close: this.handleOpenClose,

View File

@ -12,6 +12,7 @@ function noop () {
export default {
mixins: [BaseMixin],
name: 'VcTimePicker',
props: initDefaultProps({
prefixCls: PropTypes.string,
clearText: PropTypes.string,
@ -84,6 +85,13 @@ export default {
sValue: value,
}
},
mounted () {
this.$nextTick(() => {
if (this.autoFocus) {
this.focus()
}
})
},
watch: {
value (val) {