Skip to content

Commit 2f7f0e6

Browse files
authored
fix(message): getContainer prop doesn't work (#6942)
1 parent 2c4d465 commit 2f7f0e6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Diff for: components/_util/Portal.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import PropTypes from './vue-types';
2-
import { defineComponent, nextTick, onBeforeMount, onUpdated, Teleport, watch } from 'vue';
2+
import {
3+
defineComponent,
4+
nextTick,
5+
onBeforeMount,
6+
onMounted,
7+
onUpdated,
8+
Teleport,
9+
watch,
10+
} from 'vue';
311
import { useInjectPortal } from '../vc-trigger/context';
412

513
export default defineComponent({
@@ -17,6 +25,8 @@ export default defineComponent({
1725
const { shouldRender } = useInjectPortal();
1826
onBeforeMount(() => {
1927
isSSR = false;
28+
});
29+
onMounted(() => {
2030
if (shouldRender.value) {
2131
container = props.getContainer();
2232
}

Diff for: components/config-provider/hooks/useConfigInject.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default (name: string, props: Record<any, any>) => {
2424
() => props.getTargetContainer ?? configProvider.getTargetContainer?.value,
2525
);
2626
const getPopupContainer = computed(
27-
() => props.getPopupContainer ?? configProvider.getPopupContainer?.value,
27+
() => props.getContainer ?? props.getPopupContainer ?? configProvider.getPopupContainer?.value,
2828
);
2929

3030
const dropdownMatchSelectWidth = computed<boolean | number>(

0 commit comments

Comments
 (0)