diff --git a/src/_common b/src/_common index 1873fcceb..17d0a74f7 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit 1873fcceb1c8a045dc9d26e7c626fec6467c52dc +Subproject commit 17d0a74f75281bb4abff81ed90184cc78c568aae diff --git a/src/auto-complete/__tests__/vitest-auto-complete.test.jsx b/src/auto-complete/__tests__/vitest-auto-complete.test.jsx index 9ffbcdd5b..7760c4d85 100644 --- a/src/auto-complete/__tests__/vitest-auto-complete.test.jsx +++ b/src/auto-complete/__tests__/vitest-auto-complete.test.jsx @@ -171,7 +171,7 @@ describe('AutoComplete Component', () => { wrapper.find('input').trigger('focus'); await wrapper.vm.$nextTick(); const emptyOptionsClassNameTAutocompletePanelDom = document.querySelectorAll( - '.empty-options-class-name .t-autocomplete__panel', + '.empty-options-class-name .t-auto-complete__panel', ); expect(emptyOptionsClassNameTAutocompletePanelDom.length).toBe(0); // remove nodes from document to avoid influencing following test cases diff --git a/src/auto-complete/auto-complete.tsx b/src/auto-complete/auto-complete.tsx index 17349f315..9c676d69e 100644 --- a/src/auto-complete/auto-complete.tsx +++ b/src/auto-complete/auto-complete.tsx @@ -178,7 +178,7 @@ export default defineComponent({ const topContent = renderTNodeJSX(this, 'panelTopContent'); const bottomContent = renderTNodeJSX(this, 'panelBottomContent'); const panelContent = topContent || this.options?.length || bottomContent ? ( -
+
{topContent} {listContent} {bottomContent} diff --git a/src/auto-complete/option-list.tsx b/src/auto-complete/option-list.tsx index 4132be197..d8cb86640 100644 --- a/src/auto-complete/option-list.tsx +++ b/src/auto-complete/option-list.tsx @@ -7,7 +7,7 @@ import HighlightOption from './highlight-option'; import { CommonClassNameType } from '../hooks/useCommonClassName'; import { AutoCompleteOptionObj, TdAutoCompleteProps } from './type'; import log from '../_common/js/log'; -import { usePrefixClass } from '../hooks/useConfig'; +import { useConfig, usePrefixClass } from '../hooks/useConfig'; import { on, off } from '../utils/dom'; export default defineComponent({ @@ -28,6 +28,8 @@ export default defineComponent({ const active = ref(''); const classPrefix = usePrefixClass(); + const { globalConfig } = useConfig('autoComplete'); + const classes = computed(() => `${classPrefix.value}-select__list`); const optionClasses = computed(() => [ `${classPrefix.value}-select-option`, @@ -129,6 +131,7 @@ export default defineComponent({ }); return { + globalConfig, classes, classPrefix, optionClasses, @@ -141,7 +144,7 @@ export default defineComponent({ }, render() { - if (!this.tOptions.length) return null; + if (!this.tOptions.length) return
{this.globalConfig.empty}
; return (