From 6efbf3ce856fa586d7581f2806faf663adf24e80 Mon Sep 17 00:00:00 2001 From: zhanghaibo Date: Mon, 18 Apr 2022 17:17:36 +0800 Subject: [PATCH] support update SA dialog Signed-off-by: zhanghaibo --- runtime/main/model/events.ts | 1 + runtime/main/model/pageLife.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/runtime/main/model/events.ts b/runtime/main/model/events.ts index c2f328db..d338c80d 100644 --- a/runtime/main/model/events.ts +++ b/runtime/main/model/events.ts @@ -123,6 +123,7 @@ export const LIFE_CYCLE_TYPES: Array = [ PageLifecycleHooks.ONACTIVE, PageLifecycleHooks.ONINACTIVE, PageLifecycleHooks.ONLAYOUTREADY, + PageLifecycleHooks.ONDIALOGUPDATED, 'onAttached', 'onDetached', 'onPageShow', diff --git a/runtime/main/model/pageLife.ts b/runtime/main/model/pageLife.ts index aff44b3e..b79e87c5 100644 --- a/runtime/main/model/pageLife.ts +++ b/runtime/main/model/pageLife.ts @@ -96,7 +96,11 @@ export const enum PageLifecycleHooks { /** * ONLAYOUTREADY Type */ - ONINACTIVE = 'onInactive' + ONINACTIVE = 'onInactive', + /** + * ONDIALOGUPDATED Type + */ + ONDIALOGUPDATED = 'onDialogUpdated' } /* eslint-enable no-unused-vars */ @@ -114,7 +118,8 @@ const PAGE_LIFE_CYCLE_TYPES: Array = [ PageLifecycleHooks.ONCONFIGURATIONUPDATED, PageLifecycleHooks.ONLAYOUTREADY, PageLifecycleHooks.ONACTIVE, - PageLifecycleHooks.ONINACTIVE + PageLifecycleHooks.ONINACTIVE, + PageLifecycleHooks.ONDIALOGUPDATED ]; /** @@ -184,6 +189,8 @@ export function bindPageLifeCycle(vm: Vm, element: Element): void { return handleRestoreData(args[0]); } else if (type === PageLifecycleHooks.ONCOMPLETECONTINUATION) { return vm.$emitDirect(`hook:${type}`, ...args); + } else if (type === PageLifecycleHooks.ONDIALOGUPDATED) { + return vm.$emitDirect(`hook:${type}`, args[0]); } else { return vm.$emit(`hook:${type}`, {}, ...args); }