diff --git a/packages/components/time-select/src/time-select.vue b/packages/components/time-select/src/time-select.vue index 935f03234e..2652fd9453 100644 --- a/packages/components/time-select/src/time-select.vue +++ b/packages/components/time-select/src/time-select.vue @@ -23,7 +23,7 @@ :disabled="item.disabled" /> @@ -37,6 +37,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat.js' import ElSelect from '@element-plus/components/select' import ElIcon from '@element-plus/components/icon' import { CircleClose, Clock } from '@element-plus/icons-vue' +import { useNamespace } from '@element-plus/hooks' import { componentSizes } from '@element-plus/constants' import type { Component, PropType } from 'vue' @@ -170,8 +171,9 @@ export default defineComponent({ }, emits: ['change', 'blur', 'focus', 'update:modelValue'], setup(props) { - // computed + const nsInput = useNamespace('input') const select = ref(null) + const value = computed(() => props.modelValue) const start = computed(() => { const time = parseTime(props.start) @@ -219,6 +221,7 @@ export default defineComponent({ } return { + nsInput, select, value, items,