File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,24 @@ export default defineComponent({
23
23
// getContainer 不会改变,不用响应式
24
24
let container : HTMLElement ;
25
25
const { shouldRender } = useInjectPortal ( ) ;
26
+
27
+ function setContainer ( ) {
28
+ if ( shouldRender . value ) {
29
+ container = props . getContainer ( ) ;
30
+ }
31
+ }
32
+
26
33
onBeforeMount ( ( ) => {
27
34
isSSR = false ;
35
+ // drawer
36
+ setContainer ( ) ;
28
37
} ) ;
29
38
onMounted ( ( ) => {
30
- if ( shouldRender . value ) {
31
- container = props . getContainer ( ) ;
32
- }
39
+ if ( container ) return ;
40
+ // https://github.com/vueComponent/ant-design-vue/issues/6937
41
+ setContainer ( ) ;
33
42
} ) ;
43
+
34
44
const stopWatch = watch ( shouldRender , ( ) => {
35
45
if ( shouldRender . value && ! container ) {
36
46
container = props . getContainer ( ) ;
Original file line number Diff line number Diff line change @@ -90,8 +90,7 @@ const Holder = defineComponent({
90
90
closable : false ,
91
91
closeIcon : mergedCloseIcon ,
92
92
duration : props . duration ?? DEFAULT_DURATION ,
93
- getContainer : ( ) =>
94
- props . staticGetContainer ?.( ) || getPopupContainer . value ?.( ) || document . body ,
93
+ getContainer : props . staticGetContainer ?? getPopupContainer . value ,
95
94
maxCount : props . maxCount ,
96
95
onAllRemoved : props . onAllRemoved ,
97
96
} ) ;
You can’t perform that action at this time.
0 commit comments