fix: time-picker focus blur autoFocus not work
parent
d6aeb976b1
commit
28d009d3ce
|
@ -55,6 +55,8 @@ export const TimePickerProps = () => ({
|
||||||
align: PropTypes.object,
|
align: PropTypes.object,
|
||||||
placement: PropTypes.any,
|
placement: PropTypes.any,
|
||||||
transitionName: PropTypes.string,
|
transitionName: PropTypes.string,
|
||||||
|
autoFocus: PropTypes.bool,
|
||||||
|
addon: PropTypes.any,
|
||||||
})
|
})
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -146,6 +148,7 @@ export default {
|
||||||
class: className,
|
class: className,
|
||||||
ref: 'timePicker',
|
ref: 'timePicker',
|
||||||
on: {
|
on: {
|
||||||
|
...this.$listeners,
|
||||||
change: this.handleChange,
|
change: this.handleChange,
|
||||||
open: this.handleOpenClose,
|
open: this.handleOpenClose,
|
||||||
close: this.handleOpenClose,
|
close: this.handleOpenClose,
|
||||||
|
|
|
@ -12,6 +12,7 @@ function noop () {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
|
name: 'VcTimePicker',
|
||||||
props: initDefaultProps({
|
props: initDefaultProps({
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
clearText: PropTypes.string,
|
clearText: PropTypes.string,
|
||||||
|
@ -84,6 +85,13 @@ export default {
|
||||||
sValue: value,
|
sValue: value,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.autoFocus) {
|
||||||
|
this.focus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
value (val) {
|
value (val) {
|
||||||
|
|
Loading…
Reference in New Issue