fix(message): getContainer prop doesn't work (#6942)

This commit is contained in:
Konv Suu 2023-09-15 14:21:22 +08:00 committed by GitHub
parent 2c4d4650da
commit 2f7f0e6928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,13 @@
import PropTypes from './vue-types';
import { defineComponent, nextTick, onBeforeMount, onUpdated, Teleport, watch } from 'vue';
import {
defineComponent,
nextTick,
onBeforeMount,
onMounted,
onUpdated,
Teleport,
watch,
} from 'vue';
import { useInjectPortal } from '../vc-trigger/context';
export default defineComponent({
@ -17,6 +25,8 @@ export default defineComponent({
const { shouldRender } = useInjectPortal();
onBeforeMount(() => {
isSSR = false;
});
onMounted(() => {
if (shouldRender.value) {
container = props.getContainer();
}

View File

@ -24,7 +24,7 @@ export default (name: string, props: Record<any, any>) => {
() => props.getTargetContainer ?? configProvider.getTargetContainer?.value,
);
const getPopupContainer = computed(
() => props.getPopupContainer ?? configProvider.getPopupContainer?.value,
() => props.getContainer ?? props.getPopupContainer ?? configProvider.getPopupContainer?.value,
);
const dropdownMatchSelectWidth = computed<boolean | number>(