mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
refactor(components): [time-select] use useNamespace (#6459)
This commit is contained in:
parent
f333ab898b
commit
2afb4a8611
@ -23,7 +23,7 @@
|
||||
:disabled="item.disabled"
|
||||
/>
|
||||
<template #prefix>
|
||||
<el-icon v-if="prefixIcon" class="el-input__prefix-icon">
|
||||
<el-icon v-if="prefixIcon" :class="nsInput.e('prefix-icon')">
|
||||
<component :is="prefixIcon" />
|
||||
</el-icon>
|
||||
</template>
|
||||
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user