Skip to content

Commit e9b2c0e

Browse files
committed
fix(Dialog): attach should work when showInAttachedElement is true (#3692)
* fix(Dialog): attach should work when showInAttachedElement is true * fix(drawer): attach should work when showInAttachedElement is true
1 parent 0bab3fc commit e9b2c0e

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/dialog/_example/attach.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<t-dialog
5050
:visible.sync="visibleShowInAttachedElement"
5151
header="对话框仅展示在挂载元素区域"
52+
attach=".dialog-attach-wrap"
5253
:showInAttachedElement="true"
5354
placement="center"
5455
:onConfirm="() => (this.visibleShowInAttachedElement = false)"

src/dialog/dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default mixins(
153153
return !this.isFullScreen ? { width: getCSSValue(this.width), ...this.dialogStyle } : { ...this.dialogStyle }; // width全屏模式不生效;
154154
},
155155
computedAttach(): AttachNode {
156-
return this.showInAttachedElement || this.isNormal ? undefined : this.attach || this.globalAttach();
156+
return this.isNormal ? undefined : this.attach || this.globalAttach();
157157
},
158158
},
159159

src/drawer/_example/attach-parent.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<template>
22
<div class="t-container">
33
<div class="t-suf-container">
4-
<t-drawer :visible.sync="visible" :placement="placement" :mode="mode" header="抽屉标题" showInAttachedElement>
4+
<t-drawer
5+
:visible.sync="visible"
6+
:placement="placement"
7+
:mode="mode"
8+
header="抽屉标题"
9+
showInAttachedElement
10+
attach=".t-suf-container"
11+
>
512
<p>抽屉的内容</p>
613
</t-drawer>
714
<div class="tdesign-radio-button">

src/drawer/drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default mixins(
122122
};
123123
},
124124
computedAttach(): AttachNode {
125-
return this.showInAttachedElement ? undefined : this.attach || this.globalAttach();
125+
return this.attach || this.globalAttach();
126126
},
127127
},
128128

0 commit comments

Comments
 (0)