Skip to content

Commit 11dfb14

Browse files
uyarnhuangchen1031github-actions[bot]myronliu347betavs
authored
chore: release 1.10.8-naruto (#3448)
* fix(upload): 上传组件图片展示样式优化 (#3429) * fix(upload): 上传组件图片展示样式优化 * chore: update snapshot --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: radio options support radio button (#3402) * docs: add readonly in api * feat(RadioGroup): 单选组使用options时 支持button 模式 * fix(Dialog): fix closeOnOverlayClick default behavior (#3433) * fix(cascader): change event is triggered unexpectedly when value-type is full (#3435) * fix(cascader): verify invalid value logic errors and optimize code (#3438) * feat(radio): support readonly (#3431) * feat(radio): support readonly * docs: api update * feat(Table): support rows highlight (#3442) * feat(Table): support row highlight * chore: update snapshot * chore: update snapshot * chore: update snapshot * fix(PR_COMMENT_CI): resolve auto conflicts (#3443) * fix(select): `onInputChange` miss callback second parameters (#3427) * fix(select): `onInputChange` miss callback second parameters * chore: complete params * chore: fix lint --------- Co-authored-by: Uyarn <uyarnchen@gmail.com> * fix(select): `checkAll` will check all filtered data of `reserveKeyword` (#3440) * perf(select): `checkAll` will check all to keep the filtered data of `reserveKeyword` * chore: remove unuse code * chore(deps): upgrade vitest 2.1.8 (#3424) * chore(deps): upgrade vitest 2.1.8 * chore: use @vitest/coverage-v8 * chore: update snapshot * chore: fix * chore: fix * chore: update snapshot * chore: update snapshot --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * perf(select): support rendering children when `group` title is not exist (#3445) * feat(attach): support global attach config (#3437) * feat: support global config attach * chore: update common * chore: api update * fix: test * fix: test * chore: update snapshot * chore: clear typograph code * chore: clear typograph code * chore: revert irrelevant docs change * feat: fix config * feat: fix config --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Uyarn <uyarnchen@gmail.com> * chore: release 1.10.8 (#3447) * chore: release 1.10.8 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: release 1.10.8-naruto --------- Co-authored-by: huangchen1031 <huangchen1031@vip.qq.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: myron <myronliu347@gmail.com> Co-authored-by: betavs <34408516+betavs@users.noreply.github.com> Co-authored-by: liweijie0812 <674416404@qq.com> Co-authored-by: 阿菜 Cai <1064425721@qq.com>
1 parent 2e62d7c commit 11dfb14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1446
-4125
lines changed

.github/workflows/pr-comment-ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ jobs:
184184
git status
185185
conflict_count=$(git status | grep -c 'both modified:') || true
186186
working_tree_clean=$(git status | grep -c 'nothing to commit, working tree clean') || true
187-
csr_snap_conflict=$(git status | grep 'both modified:' | grep -c 'csr.test.jsx.snap') || true
188-
ssr_snap_conflict=$(git status | grep 'both modified:' | grep -c 'ssr.test.jsx.snap') || true
187+
csr_snap_conflict=$(git status | grep 'both modified:' | grep -c 'csr.test.js.snap') || true
188+
ssr_snap_conflict=$(git status | grep 'both modified:' | grep -c 'ssr.test.js.snap') || true
189189
common_conflict=$(git status | grep 'both modified:' | grep -c '_common') || true
190190
conflicts_sum=$((csr_snap_conflict + ssr_snap_conflict + common_conflict))
191191
echo "conflict_count: $conflict_count"
@@ -207,15 +207,15 @@ jobs:
207207
fi
208208
209209
if [ "$csr_snap_conflict" -eq "1" ];then
210-
git checkout --theirs test/snap/__snapshots__/csr.test.jsx.snap
211-
git add test/snap/__snapshots__/csr.test.jsx.snap
212-
echo "resolve conflict csr.test.jsx.snap"
210+
git checkout --theirs test/snap/__snapshots__/csr.test.js.snap
211+
git add test/snap/__snapshots__/csr.test.js.snap
212+
echo "resolve conflict csr.test.js.snap"
213213
fi
214214
215215
if [ "$ssr_snap_conflict" -eq "1" ];then
216-
git checkout --theirs test/snap/__snapshots__/ssr.test.jsx.snap
217-
git add test/snap/__snapshots__/ssr.test.jsx.snap
218-
echo "resolve conflict ssr.test.jsx.snap"
216+
git checkout --theirs test/snap/__snapshots__/ssr.test.js.snap
217+
git add test/snap/__snapshots__/ssr.test.js.snap
218+
echo "resolve conflict ssr.test.js.snap"
219219
fi
220220
221221
if [ "$common_conflict" -eq "1" ];then

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ toc: false
55
docClass: timeline
66
---
77

8+
## 🌈 1.10.8 `2024-12-30`
9+
### 🚀 Features
10+
- `ConfigProvider`: 新增`attach` 配置,支持全局设置`Popup``Dialog``Drawer`的挂载节点 @liweijie0812 ([#3437](https://github.com/Tencent/tdesign-vue/pull/3437))
11+
- `Radio`: 新增`theme`API,用于配置 `RadioGroup` 使用`options` 时渲染的子组件样式 @myronliu347 ([#3402](https://github.com/Tencent/tdesign-vue/pull/3402))
12+
- `Radio`: 新增 `readonly` API,用于支持只读属性配置 @liweijie0812 ([#3431](https://github.com/Tencent/tdesign-vue/pull/3431))
13+
- `Table`: 支持行高亮功能及相关操作,具体使用请参考示例代码 @uyarn ([#3442](https://github.com/Tencent/tdesign-vue/pull/3442))
14+
15+
### 🐞 Bug Fixes
16+
- `Cascader`@betavs
17+
-`valueType``full` 时会意外触发 `change` 事件 ([#3435](https://github.com/Tencent/tdesign-vue/pull/3435))
18+
- 修复`valueType``full``showAllLevels ``false`无法正常展示的功能问题 ([#3438](https://github.com/Tencent/tdesign-vue/pull/3438))
19+
- `Dialog`: 修复默认挂载节点非`body`的异常 @liweijie0812 ([#3437](https://github.com/Tencent/tdesign-vue/pull/3437))
20+
- `Dialog`: 修复`1.10.6`版本`closeOnOverlayClick`的默认行为异常的问题 @uyarn ([#3433](https://github.com/Tencent/tdesign-vue/pull/3433))
21+
- `Select`: @RSS1102
22+
- 修复`onInputChange` 事件丢失第二个回调参数的问题 ([#3427](https://github.com/Tencent/tdesign-vue/pull/3427))
23+
- 优化`reserveKeyword`配合`filterable`在全选下的行为 ([#3440](https://github.com/Tencent/tdesign-vue/pull/3440))
24+
- 修复分组情况下标题不存在的渲染报错的问题 ([#3445](https://github.com/Tencent/tdesign-vue/pull/3445))
25+
### 📝 Documentation
26+
- `ConfigProvider`: 补充`Empty`组件的全局配置相关文档 @liweijie0812 ([#3437](https://github.com/Tencent/tdesign-vue/pull/3437))
27+
- `Upload`: 优化上传组件图片展示样式 @huangchen1031 ([#3429](https://github.com/Tencent/tdesign-vue/pull/3429))
28+
29+
830
## 🌈 1.10.7 `2024-12-16`
931
### 🐞 Bug Fixes
1032
- `ColorPicker`: 修复颜色选择器的国际化配置问题 @liweijie0812 ([#3403](https://github.com/Tencent/tdesign-vue/pull/3403))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tdesign-vue",
33
"purename": "tdesign",
4-
"version": "1.10.7-naruto",
4+
"version": "1.10.8-naruto",
55
"description": "tdesign-vue",
66
"title": "tdesign-vue",
77
"keywords": [

src/anchor/__tests__/index.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ describe('Anchor', () => {
144144
},
145145
}).findComponent(Anchor);
146146
const links = wrapper.findAllComponents(AnchorItem);
147+
147148
links.at(0).find('a').trigger('click');
148149
expect(onChange).toBeCalledTimes(2);
149150
expect(onChange).toBeCalledWith('#test-b', '');

src/cascader/core/helper.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function getSingleContent(cascaderContext: CascaderContextType): string {
2727
}
2828
const path = node && node[0].getPath();
2929
if (path && path.length) {
30-
return showAllLevels ? path.map((node: TreeNode) => node.label).join(' / ') : path[path.length - 1].label;
30+
return showAllLevels ? path.map((node: TreeNode) => node.label).join(' / ') : path.at(-1).label;
3131
}
3232
return value as string;
3333
}
@@ -120,10 +120,11 @@ export const getCascaderValue = (value: CascaderValue, valueType: TdCascaderProp
120120
if (valueType === 'single') {
121121
return value;
122122
}
123+
const val = value as Array<CascaderValue>;
123124
if (multiple) {
124-
return (value as Array<CascaderValue>).map((item: TreeNodeValue[]) => item[item.length - 1]);
125+
return val.map((item: TreeNodeValue[]) => item.at(-1));
125126
}
126-
return value[(value as Array<CascaderValue>).length - 1];
127+
return val.at(-1);
127128
};
128129

129130
/**
@@ -144,6 +145,9 @@ export function isEmptyValues(value: unknown): boolean {
144145
* @returns boolean
145146
*/
146147
export function isValueInvalid(value: CascaderValue, cascaderContext: CascaderContextType) {
147-
const { multiple, showAllLevels } = cascaderContext;
148-
return (multiple && !Array.isArray(value)) || (!multiple && Array.isArray(value) && !showAllLevels);
148+
const { multiple, showAllLevels, valueType } = cascaderContext;
149+
return (
150+
(multiple && !Array.isArray(value))
151+
|| (!multiple && Array.isArray(value) && valueType === 'single' && !showAllLevels)
152+
);
149153
}

src/cascader/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const useContext = (
7676
statusContext.treeNodes = nodes;
7777
},
7878
setValue: (val: CascaderValue, source: CascaderChangeSource, node?: TreeNodeModel) => {
79-
if (isEqual(val, statusContext.scopeVal)) return;
79+
if (isEqual(val, value)) return;
8080
setInnerValue(val, { source, node });
8181
},
8282
setVisible: setPopupVisible,

src/config-provider/config-provider.en-US.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ name | type | default | description | required
6262
alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N
6363
anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N
6464
animation | Object | - | Typescript:`Partial<Record<'include'\|'exclude', Array<AnimationType>>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N
65+
attach | String / Object / Function | - | Typescript:`AttachNode \| { popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
6566
calendar | Object | - | Calendar global configs。Typescript:`CalendarConfig` | N
6667
cascader | Object | - | Cascader global configs。Typescript:`CascaderConfig` | N
6768
classPrefix | String | t | \- | N
@@ -70,6 +71,7 @@ datePicker | Object | - | DatePicker global configs。Typescript:`DatePickerCo
7071
descriptions | Object | - | Descriptions global configs。Typescript:`DescriptionsConfig` | N
7172
dialog | Object | - | Dialog global configs。Typescript:`DialogConfig` | N
7273
drawer | Object | - | Drawer global configs。Typescript:`DrawerConfig` | N
74+
empty | Object | - | Empty global configs。Typescript:`EmptyConfig` | N
7375
form | Object | - | Form global configs。Typescript:`FormConfig` | N
7476
guide | Object | - | Guide global configs。Typescript:`GuideConfig` | N
7577
icon | Object | - | icon config。Typescript:`IconConfig` `type IconConfig = GlobalIconConfig` `import { GlobalIconConfig } from '@icon'`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N
@@ -390,3 +392,10 @@ skipButtonProps | Object | - | skip button. `{ content: 'Skip', theme: 'default'
390392
name | type | default | description | required
391393
-- | -- | -- | -- | --
392394
rateText | Array | - | Typescript:`string[]` | N
395+
396+
### EmptyConfig
397+
398+
name | type | default | description | required
399+
-- | -- | -- | -- | --
400+
image | Object | - | Typescript:`{ maintenance: TNode; success: TNode; fail: TNode; empty: TNode; networkError: TNode; }`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
401+
titleText | Object | - | Typescript:`{ maintenance: string; success: string; fail: string; empty: string; networkError: string; }` | N

src/config-provider/config-provider.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Vue.use(TDesign);
6363
alert | Object | - | 警告全局配置。TS 类型:`AlertConfig` | N
6464
anchor | Object | - | 锚点全局配置。TS 类型:`AnchorConfig` | N
6565
animation | Object | - | 动画效果控制,`ripple` 指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }`。TS 类型:`Partial<Record<'include'\|'exclude', Array<AnimationType>>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N
66+
attach | String / Object / Function | - | TS 类型:`AttachNode \| { popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
6667
calendar | Object | - | 日历组件全局配置。TS 类型:`CalendarConfig` | N
6768
cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfig` | N
6869
classPrefix | String | t | CSS 类名前缀 | N
@@ -71,6 +72,7 @@ datePicker | Object | - | 日期选择器全局配置。TS 类型:`DatePickerC
7172
descriptions | Object | - | 描述全局配置。TS 类型:`DescriptionsConfig` | N
7273
dialog | Object | - | 对话框全局配置。TS 类型:`DialogConfig` | N
7374
drawer | Object | - | 抽屉全局配置。TS 类型:`DrawerConfig` | N
75+
empty | Object | - | 空状态全局配置。TS 类型:`EmptyConfig` | N
7476
form | Object | - | 表单组件全局配置。TS 类型:`FormConfig` | N
7577
guide | Object | - | 引导全局配置。TS 类型:`GuideConfig` | N
7678
icon | Object | - | 图标全局配置。TS 类型:`IconConfig` `type IconConfig = GlobalIconConfig` `import { GlobalIconConfig } from '@icon'`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N
@@ -391,3 +393,10 @@ skipButtonProps | Object | - | 跳过按钮,示例:`{ content: '跳过', the
391393
名称 | 类型 | 默认值 | 描述 | 必传
392394
-- | -- | -- | -- | --
393395
rateText | Array | - | 评分描述,默认值:['极差', '失望', '一般', '满意', '惊喜']。TS 类型:`string[]` | N
396+
397+
### EmptyConfig
398+
399+
名称 | 类型 | 默认值 | 描述 | 必传
400+
-- | -- | -- | -- | --
401+
image | Object | - | 空状态组件各类型的图片配置。TS 类型:`{ maintenance: TNode; success: TNode; fail: TNode; empty: TNode; networkError: TNode; }`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
402+
titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类型:`{ maintenance: string; success: string; fail: string; empty: string; networkError: string; }` | N

src/config-provider/config-receiver.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { GlobalIconConfig } from 'tdesign-icons-vue';
44
import { defaultGlobalConfig } from './context';
55
import { GlobalConfigProvider, AnimationType } from './type';
66

7+
import type { AttachNode } from '../common';
8+
79
export type ValueOf<T> = T[keyof T];
810

911
export type ComponentConfigType = ValueOf<GlobalConfigProvider>;
@@ -202,3 +204,21 @@ export function getClassPrefixMixins(componentName: string) {
202204
},
203205
});
204206
}
207+
208+
// 用于非 composition api 的组件使用来自 config provider注入的 attach 使用
209+
export function getAttachConfigMixins(componentName: string) {
210+
return (Vue as VueConstructor<ConfigComponent>).extend({
211+
name: 'TAttachProvider',
212+
inject: {
213+
globalConfig: {
214+
default: undefined,
215+
},
216+
},
217+
methods: {
218+
globalAttach(): AttachNode {
219+
// @ts-ignore
220+
return this.globalConfig?.attach?.[componentName] || this.globalConfig?.attach || 'body';
221+
},
222+
},
223+
});
224+
}

src/config-provider/type.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ButtonProps } from '../button';
1010
import { FormErrorMessage } from '../form';
1111
import { MessageOptions } from '../message';
1212
import { ImageProps } from '../image';
13-
import { TNode, SizeEnum } from '../common';
13+
import { TNode, SizeEnum, AttachNode } from '../common';
1414

1515
export interface GlobalConfigProvider {
1616
/**
@@ -25,6 +25,10 @@ export interface GlobalConfigProvider {
2525
* 动画效果控制,`ripple` 指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }`
2626
*/
2727
animation?: Partial<Record<'include' | 'exclude', Array<AnimationType>>>;
28+
/**
29+
* null
30+
*/
31+
attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode };
2832
/**
2933
* 日历组件全局配置
3034
*/

src/dialog/dialog.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ import { DialogCloseContext, TdDialogProps } from './type';
1414
import props from './props';
1515
import { renderTNodeJSX, renderContent } from '../utils/render-tnode';
1616
import mixins from '../utils/mixins';
17-
import getConfigReceiverMixins, { DialogConfig, getGlobalIconMixins } from '../config-provider/config-receiver';
17+
import getConfigReceiverMixins, {
18+
DialogConfig,
19+
getGlobalIconMixins,
20+
getAttachConfigMixins,
21+
} from '../config-provider/config-receiver';
1822
import TransferDom from '../utils/transfer-dom';
1923
import { emitEvent } from '../utils/event';
20-
import { ClassName, Styles } from '../common';
24+
import { AttachNode, ClassName, Styles } from '../common';
2125
import { updateElement } from '../hooks/useDestroyOnClose';
2226
import stack from './stack';
2327
import { getScrollbarWidth } from '../_common/js/utils/getScrollbarWidth';
@@ -43,7 +47,12 @@ if (typeof window !== 'undefined' && window.document && window.document.document
4347

4448
let key = 1;
4549

46-
export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('dialog'), getGlobalIconMixins()).extend({
50+
export default mixins(
51+
ActionMixin,
52+
getConfigReceiverMixins<Vue, DialogConfig>('dialog'),
53+
getGlobalIconMixins(),
54+
getAttachConfigMixins('dialog'),
55+
).extend({
4756
name: 'TDialog',
4857

4958
components: {
@@ -144,6 +153,9 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d
144153
computedDialogStyle(): Styles {
145154
return !this.isFullScreen ? { width: getCSSValue(this.width), ...this.dialogStyle } : { ...this.dialogStyle }; // width全屏模式不生效;
146155
},
156+
computedAttach(): AttachNode {
157+
return this.showInAttachedElement ? undefined : this.attach || this.globalAttach();
158+
},
147159
},
148160

149161
watch: {
@@ -518,7 +530,7 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DialogConfig>('d
518530
onBeforeLeave={this.beforeLeave}
519531
onAfterLeave={this.afterLeave}
520532
>
521-
<div v-show={this.visible} class={this.ctxClass} style={ctxStyle} v-transfer-dom={this.attach}>
533+
<div v-show={this.visible} class={this.ctxClass} style={ctxStyle} v-transfer-dom={this.computedAttach}>
522534
{view}
523535
</div>
524536
</transition>

src/dialog/props.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export default {
3131
default: undefined,
3232
},
3333
/** 点击蒙层时是否触发关闭事件 */
34-
closeOnOverlayClick: Boolean,
34+
closeOnOverlayClick: {
35+
type: Boolean,
36+
default: undefined,
37+
},
3538
/** 确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制确认事件 */
3639
confirmBtn: {
3740
type: [String, Object, Function] as PropType<TdDialogProps['confirmBtn']>,

src/drawer/drawer.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,27 @@ import props from './props';
66
import { FooterButton, DrawerCloseContext, TdDrawerProps } from './type';
77
import { renderTNodeJSX, renderContent } from '../utils/render-tnode';
88
import mixins from '../utils/mixins';
9-
import getConfigReceiverMixins, { DrawerConfig, getGlobalIconMixins } from '../config-provider/config-receiver';
9+
import getConfigReceiverMixins, {
10+
DrawerConfig,
11+
getGlobalIconMixins,
12+
getAttachConfigMixins,
13+
} from '../config-provider/config-receiver';
1014
import TransferDom from '../utils/transfer-dom';
1115
import { emitEvent } from '../utils/event';
12-
import { ClassName, Styles } from '../common';
16+
import { AttachNode, ClassName, Styles } from '../common';
1317
import ActionMixin from '../dialog/actions';
1418
import { getScrollbarWidth } from '../_common/js/utils/getScrollbarWidth';
1519

1620
type FooterButtonType = 'confirm' | 'cancel';
1721

1822
let key = 1;
1923

20-
export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DrawerConfig>('drawer'), getGlobalIconMixins()).extend({
24+
export default mixins(
25+
ActionMixin,
26+
getConfigReceiverMixins<Vue, DrawerConfig>('drawer'),
27+
getGlobalIconMixins(),
28+
getAttachConfigMixins('drawer'),
29+
).extend({
2130
name: 'TDrawer',
2231

2332
components: {
@@ -110,6 +119,9 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DrawerConfig>('d
110119
cursor: this.isHorizontal ? 'col-resize' : 'row-resize',
111120
};
112121
},
122+
computedAttach(): AttachNode {
123+
return this.showInAttachedElement ? undefined : this.attach || this.globalAttach();
124+
},
113125
},
114126

115127
watch: {
@@ -180,7 +192,7 @@ export default mixins(ActionMixin, getConfigReceiverMixins<Vue, DrawerConfig>('d
180192
class={this.drawerClasses}
181193
style={{ zIndex: this.zIndex }}
182194
onKeydown={this.onKeyDown}
183-
v-transfer-dom={this.attach}
195+
v-transfer-dom={this.computedAttach}
184196
ref="drawerContainer"
185197
tabindex={0}
186198
v-show={this.visible}

src/popup/popup.en-US.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:: BASE_DOC ::
22

33
## API
4+
45
### Popup Props
56

67
name | type | default | description | required
@@ -19,7 +20,7 @@ overlayStyle | Boolean / Object / Function | - | Typescript:`Styles \| ((trigg
1920
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/tree/develop/src/popup/type.ts) | N
2021
popperOptions | Object | - | popper initial options,details refer to https://popper.js.org/docs | N
2122
showArrow | Boolean | false | \- | N
22-
trigger | String | hover | optionshover/click/focus/mousedown/context-menu | N
23+
trigger | String | hover | options: hover/click/focus/mousedown/context-menu | N
2324
triggerElement | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
2425
visible | Boolean | - | `v-model` is supported。Typescript:`boolean` | N
2526
defaultVisible | Boolean | - | uncontrolled property。Typescript:`boolean` | N
@@ -44,4 +45,4 @@ name | params | default | description
4445
-- | -- | -- | --
4546
content | String / Slot / Function | - | required。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)
4647
popupProps | Object | - | \-
47-
triggerElement | String | - | required
48+
triggerElement | String | - | required

0 commit comments

Comments
 (0)