mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
fix(vue): components inside of ion-nav are now unmounted properly (#23240)
resolves #23233
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { h, Teleport, VNode } from 'vue';
|
||||
import { addTeleportedUserComponent, removeTeleportedUserComponent } from './components/IonApp';
|
||||
export const VueDelegate = () => {
|
||||
export const VueDelegate = (addFn = addTeleportedUserComponent, removeFn = removeTeleportedUserComponent) => {
|
||||
let Component: VNode | undefined;
|
||||
const attachViewToDom = (parentElement: HTMLElement, component: any, componentProps: any = {}, classes?: string[]) => {
|
||||
/**
|
||||
@ -22,13 +22,13 @@ export const VueDelegate = () => {
|
||||
h(component, { ...componentProps })
|
||||
);
|
||||
|
||||
addTeleportedUserComponent(Component);
|
||||
addFn(Component);
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
const removeViewFromDom = () => {
|
||||
Component && removeTeleportedUserComponent(Component);
|
||||
Component && removeFn(Component);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user