<template>
    <a-time-picker class="dhc-ProTimePicker" popper-class="dhc-ProTimePicker_popper" v-model:value="svalue"
        @change="handleChange" @focus="handleFocus" @blur="handleBlur" v-bind="$attrs">
    </a-time-picker>
</template>
<script>
export default {
    name: 'ProTimePicker',
    props: {
        value: String,
        readIgnore: {
            type: String,
            default: null
        }
    },
    data () {
        return {
            svalue: this.value,
        }
    },
    watch: {
        value (val, oldVal) {
            if (val != oldVal) {
                this.svalue = val;
            }
        },
        //判断值是否有改变
        svalue (val, oldVal) {
            if (val != oldVal) {
                this.$emit('input', val);
            }
        },
    },
    methods: {
        //绑定值被改变时的回调
        handleChange (currentValue) {
            this.$emit('change', currentValue);
        },
        //组件 Input 失去焦点时触发
        handleFocus (event) {
            this.$emit('focus', event);
        },
        //组件 Input 获得焦点时触发
        handleBlur (event) {
            this.$emit('blur', event);
        }
    },
}
</script>
<style lang="less"></style>
