Skip to content

Commit

Permalink
fix(DropdownMenu): fixed the upward expansion style error in some models
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Sep 25, 2024
1 parent b0c1a18 commit 025a897
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/dropdown-menu/dropdown-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,10 @@ export default defineComponent({
return {
zIndex: menuProps.zIndex && menuProps.zIndex + 1,
position: 'absolute',
overflow: 'hidden',
};
});
const styleContent = computed(() => {
return [`${dropdownItemClass.value}__content`, `t-popup__content`];
});
const contentStyle = computed(() => {
return menuProps.direction === 'up' ? { transform: 'rotateX(180deg) rotateY(180deg)' } : {};
});

const popupId = getUniqueID();
// 设置展开/收起状态
const setExpand = (val: boolean) => {
Expand All @@ -94,7 +90,6 @@ export default defineComponent({

menuProps.direction === 'up'
? (state.expandStyle = {
transform: menuProps.direction === 'up' ? 'rotateX(180deg) rotateY(180deg)' : '',
zIndex: menuProps.zIndex,
bottom: `${winHeight - top}px`,
})
Expand Down Expand Up @@ -293,15 +288,15 @@ export default defineComponent({
<div id={popupId} class={classes.value} style={{ ...expandStyle.value }}>
<t-popup
visible={isShowItems.value}
placement={menuProps.direction === 'up' ? 'bottom' : 'top'}
duration={duration.value}
showOverlay={showOverlay.value}
style={popupStyle.value}
overlayProps={{ style: 'position: absolute' }}
class={`${dropdownItemClass.value}__popup-host`}
attach={`#${popupId}`}
onVisibleChange={onVisibleChange}
>
<div ref={popupContent} class={styleContent.value} style={contentStyle.value}>
<div ref={popupContent} class={`${dropdownItemClass.value}__content`}>
<div class={`${dropdownItemClass.value}__body`}>{content || defaultSlot()}</div>
{footer || footerSlot()}
</div>
Expand Down

0 comments on commit 025a897

Please sign in to comment.