mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
fix(vue): ionic lifecycle hooks now run when using vue 3.2 setup syntax (#24253)
resolves #23824 Co-authored-by: Liam DeBeasi <liamdebeasi@icloud.com>
This commit is contained in:
@ -80,6 +80,12 @@ const injectHook = (lifecycleType: LifecycleHooks, hook: Function, component: Co
|
||||
// Add to public instance so it is accessible to IonRouterOutlet
|
||||
const target = component as any;
|
||||
const hooks = target.proxy[lifecycleType] || (target.proxy[lifecycleType] = []);
|
||||
/**
|
||||
* Define property on public instances using `setup` syntax in Vue 3.x
|
||||
*/
|
||||
if (target.exposed) {
|
||||
target.exposed[lifecycleType] = hooks;
|
||||
}
|
||||
const wrappedHook = (...args: unknown[]) => {
|
||||
if (target.isUnmounted) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user