Skip to content

Commit 26d220f

Browse files
authored
fix: 修复 menu 下拉样式问题 (#1431)
* fix: 修复 menu 下拉样式问题 * fix: 修复 menu 下拉样式问题
1 parent 02a7996 commit 26d220f

File tree

7 files changed

+13
-2
lines changed

7 files changed

+13
-2
lines changed

examples/popup/popup.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ destroyOnClose | Boolean | false | \- | N
1212
disabled | Boolean | false | \- | N
1313
hideEmptyPopup | Boolean | false | \- | N
1414
overlayClassName | String / Object / Array | - | Typescript:`ClassName`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
15+
overlayInnerClassName | String / Object / Array | - | Typescript:`ClassName`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
1516
overlayInnerStyle | Boolean / Object / Function | - | Typescript:`Styles | ((triggerElement: HTMLElement, popupElement: HTMLElement) => Styles)`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
1617
overlayStyle | Boolean / Object / Function | - | Typescript:`Styles | ((triggerElement: HTMLElement, popupElement: HTMLElement) => Styles)`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
1718
placement | String | top | Typescript:`PopupPlacement` `type PopupPlacement = 'top'|'left'|'right'|'bottom'|'top-left'|'top-right'|'bottom-left'|'bottom-right'|'left-top'|'left-bottom'|'right-top'|'right-bottom'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/popup/type.ts) | N

examples/popup/popup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ destroyOnClose | Boolean | false | 是否在关闭浮层时销毁浮层 | N
1212
disabled | Boolean | false | 是否禁用组件 | N
1313
hideEmptyPopup | Boolean | false | 浮层是否隐藏空内容,默认不隐藏 | N
1414
overlayClassName | String / Object / Array | - | 浮层类名,示例:'name1 name2 name3' 或 `['name1', 'name2']``[{ 'name1': true }]`。TS 类型:`ClassName`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
15+
overlayInnerClassName | String / Object / Array | - | 浮层内容部分类名,示例:'name1 name2 name3' 或 `['name1', 'name2']``[{ 'name1': true }]`。TS 类型:`ClassName`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
1516
overlayInnerStyle | Boolean / Object / Function | - | 浮层内容部分样式,第一个参数 `triggerElement` 表示触发元素 DOM 节点,第二个参数 `popupElement` 表示浮层元素 DOM 节点。TS 类型:`Styles | ((triggerElement: HTMLElement, popupElement: HTMLElement) => Styles)`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
1617
overlayStyle | Boolean / Object / Function | - | 浮层样式,第一个参数 `triggerElement` 表示触发元素 DOM 节点,第二个参数 `popupElement` 表示浮层元素 DOM 节点。TS 类型:`Styles | ((triggerElement: HTMLElement, popupElement: HTMLElement) => Styles)`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
1718
placement | String | top | 浮层出现位置。TS 类型:`PopupPlacement` `type PopupPlacement = 'top'|'left'|'right'|'bottom'|'top-left'|'top-right'|'bottom-left'|'bottom-right'|'left-top'|'left-bottom'|'right-top'|'right-bottom'`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/popup/type.ts) | N

src/menu/submenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export default defineComponent({
211211
};
212212
const realPopup = (
213213
<Popup
214-
overlayClassName={[...this.popupClass]}
214+
overlayInnerClassName={[...this.popupClass]}
215215
visible={this.popupVisible}
216216
placement={placement as PopupPlacement}
217217
overlayInnerStyle={overlayInnerStyle}

src/popup/popup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export default defineComponent({
399399
})}
400400
>
401401
<div
402-
class={this.overlayCls}
402+
class={[this.overlayCls, this.overlayInnerClassName]}
403403
ref="overlayEl"
404404
{...(onScroll && {
405405
onScroll(e: WheelEvent) {

src/popup/props.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export default {
3131
overlayClassName: {
3232
type: [String, Object, Array] as PropType<TdPopupProps['overlayClassName']>,
3333
},
34+
/** 浮层内容部分类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]` */
35+
overlayInnerClassName: {
36+
type: [String, Object, Array] as PropType<TdPopupProps['overlayInnerClassName']>,
37+
},
3438
/** 浮层内容部分样式,第一个参数 `triggerElement` 表示触发元素 DOM 节点,第二个参数 `popupElement` 表示浮层元素 DOM 节点 */
3539
overlayInnerStyle: {
3640
type: [Boolean, Object, Function] as PropType<TdPopupProps['overlayInnerStyle']>,

src/popup/type.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export interface TdPopupProps {
3939
* 浮层类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`
4040
*/
4141
overlayClassName?: ClassName;
42+
/**
43+
* 浮层内容部分类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`
44+
*/
45+
overlayInnerClassName?: ClassName;
4246
/**
4347
* 浮层内容部分样式,第一个参数 `triggerElement` 表示触发元素 DOM 节点,第二个参数 `popupElement` 表示浮层元素 DOM 节点
4448
*/

src/slider/hooks/useSliderTooltip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const useSliderTooltip = (tooltipConfig: Ref<TooltipConfig>) => {
5252
if (!tooltipProps?.placement) {
5353
normalizeProps.value.placement = placement;
5454
}
55+
// @ts-ignore
5556
return { ...normalizeProps.value, ...tooltipProps, content };
5657
}
5758
return { ...normalizeProps.value, placement, content };

0 commit comments

Comments
 (0)