File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,24 @@ export default defineComponent({
2323 // getContainer 不会改变,不用响应式
2424 let container : HTMLElement ;
2525 const { shouldRender } = useInjectPortal ( ) ;
26+
27+ function setContainer ( ) {
28+ if ( shouldRender . value ) {
29+ container = props . getContainer ( ) ;
30+ }
31+ }
32+
2633 onBeforeMount ( ( ) => {
2734 isSSR = false ;
35+ // drawer
36+ setContainer ( ) ;
2837 } ) ;
2938 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 ( ) ;
3342 } ) ;
43+
3444 const stopWatch = watch ( shouldRender , ( ) => {
3545 if ( shouldRender . value && ! container ) {
3646 container = props . getContainer ( ) ;
Original file line number Diff line number Diff line change @@ -90,8 +90,7 @@ const Holder = defineComponent({
9090 closable : false ,
9191 closeIcon : mergedCloseIcon ,
9292 duration : props . duration ?? DEFAULT_DURATION ,
93- getContainer : ( ) =>
94- props . staticGetContainer ?.( ) || getPopupContainer . value ?.( ) || document . body ,
93+ getContainer : props . staticGetContainer ?? getPopupContainer . value ,
9594 maxCount : props . maxCount ,
9695 onAllRemoved : props . onAllRemoved ,
9796 } ) ;
You can’t perform that action at this time.
0 commit comments