From db9f6cc0e13027357eef5fe6724ad6abef328dba Mon Sep 17 00:00:00 2001 From: ajaxzheng <894103554@qq.com> Date: Mon, 25 Nov 2024 19:25:27 +0800 Subject: [PATCH] fix(dropdown): [dropdown] fixed the data disorder issue caused by the composite scenario of two-layer components and self-invoking groups. (#2553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(drop-down): [drop-down] fixed the data confusion issue of dropdwon-item component * fix(drop-down): [drop-down] fixed the data confusion issue of dropdwon-item component * fix(drop-down): 优化文字描述 * fix: fix e2e error --- .../sites/demos/pc/app/dropdown/visible-arrow.spec.ts | 2 +- packages/vue/src/dropdown-item/src/pc.vue | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/sites/demos/pc/app/dropdown/visible-arrow.spec.ts b/examples/sites/demos/pc/app/dropdown/visible-arrow.spec.ts index 0cb17672df..05e434926a 100644 --- a/examples/sites/demos/pc/app/dropdown/visible-arrow.spec.ts +++ b/examples/sites/demos/pc/app/dropdown/visible-arrow.spec.ts @@ -17,5 +17,5 @@ test('显示箭头', async ({ page }) => { await dropdownTrigger.hover() await expect(dropDownMenu).toBeVisible() await expect(arrow).toBeVisible() - await expect(arrow).toHaveCSS('top', '-8px') + await expect(arrow).toHaveCSS('top', '-7px') }) diff --git a/packages/vue/src/dropdown-item/src/pc.vue b/packages/vue/src/dropdown-item/src/pc.vue index b0bb23e951..c42e8762b2 100644 --- a/packages/vue/src/dropdown-item/src/pc.vue +++ b/packages/vue/src/dropdown-item/src/pc.vue @@ -56,7 +56,9 @@ :key="index" :label="item[state.textField]" :item-data="item" + :_constants="_constants" :icon="item.icon" + :is-mono="true" :disabled="item.disabled" :divided="item.divided" :tip="item.tip" @@ -102,13 +104,15 @@ export default defineComponent({ 'textField', 'tip', 'tipPosition', - 'effect' + 'effect', + 'isMono' ], components: { IconLeftWardArrow: iconLeftWardArrow() }, setup(props, context) { - return setup({ props, context, renderless, api }) as unknown as IDropdownItemApi + // 修复 <双层组件 + 自调用组件> 复合场景导致的数据混乱问题 + return setup({ props, context, renderless, api, mono: props.isMono }) as unknown as IDropdownItemApi } })