|
|
|
@ -61,11 +61,13 @@ export default defineComponent({
|
|
|
|
|
const container = shallowRef<HTMLElement>(); |
|
|
|
|
const componentRef = shallowRef(); |
|
|
|
|
const rafId = shallowRef<number>(); |
|
|
|
|
|
|
|
|
|
const defaultContainer = canUseDom() && document.createElement('div'); |
|
|
|
|
const removeCurrentContainer = () => { |
|
|
|
|
// Portal will remove from `parentNode`. |
|
|
|
|
// 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; |
|
|
|
|
}; |
|
|
|
|
let parent: HTMLElement = null; |
|
|
|
@ -82,8 +84,6 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
}; |
|
|
|
|
// attachToParent(); |
|
|
|
|
const defaultContainer = canUseDom() && document.createElement('div'); |
|
|
|
|
const getContainer = () => { |
|
|
|
|
if (!supportDom) { |
|
|
|
|
return null; |
|
|
|
|