|
|
@ -61,11 +61,13 @@ export default defineComponent({
|
|
|
|
const container = shallowRef<HTMLElement>();
|
|
|
|
const container = shallowRef<HTMLElement>();
|
|
|
|
const componentRef = shallowRef();
|
|
|
|
const componentRef = shallowRef();
|
|
|
|
const rafId = shallowRef<number>();
|
|
|
|
const rafId = shallowRef<number>();
|
|
|
|
|
|
|
|
const defaultContainer = canUseDom() && document.createElement('div');
|
|
|
|
const removeCurrentContainer = () => {
|
|
|
|
const removeCurrentContainer = () => {
|
|
|
|
// Portal will remove from `parentNode`.
|
|
|
|
// Portal will remove from `parentNode`.
|
|
|
|
// Let's handle this again to avoid refactor issue.
|
|
|
|
// Let's handle this again to avoid refactor issue.
|
|
|
|
container.value?.parentNode?.removeChild(container.value);
|
|
|
|
if (container.value === defaultContainer) {
|
|
|
|
|
|
|
|
container.value?.parentNode?.removeChild(container.value);
|
|
|
|
|
|
|
|
}
|
|
|
|
container.value = null;
|
|
|
|
container.value = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let parent: HTMLElement = null;
|
|
|
|
let parent: HTMLElement = null;
|
|
|
@ -82,8 +84,6 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// attachToParent();
|
|
|
|
|
|
|
|
const defaultContainer = canUseDom() && document.createElement('div');
|
|
|
|
|
|
|
|
const getContainer = () => {
|
|
|
|
const getContainer = () => {
|
|
|
|
if (!supportDom) {
|
|
|
|
if (!supportDom) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|