提交 3070023c 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊 提交者: 折腾笔记

feat(x): 调整 onShow 生命周期触发判断规则

上级 75265cbd
......@@ -7,7 +7,7 @@ import { isString, isFunction, isPromise, getGlobalThis, isArray, NOOP, extend a
export { camelize, capitalize, hyphenate, toDisplayString, toHandlerKey } from '@vue/shared';
import { pauseTracking, resetTracking, isRef, toRaw, isShallow, isReactive, ReactiveEffect, getCurrentScope, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, customRef, isReadonly } from '@vue/reactivity';
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
import { isRootHook, isRootImmediateHookX, ON_LOAD, normalizeClass as normalizeClass$1, normalizeStyle as normalizeStyle$1 } from '@dcloudio/uni-shared';
import { isRootHook, isRootImmediateHook, ON_LOAD, normalizeClass as normalizeClass$1, normalizeStyle as normalizeStyle$1 } from '@dcloudio/uni-shared';
export { normalizeClass, normalizeProps, normalizeStyle } from '@dcloudio/uni-shared';
import PromisePolyfill from 'promise-polyfill';
......@@ -2859,7 +2859,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
if (target) {
if (isRootHook(type) && target !== target.root) {
target = target.root;
if (isRootImmediateHookX(type)) {
if (isRootImmediateHook(type)) {
const proxy = target.proxy;
callWithAsyncErrorHandling(
hook.bind(proxy),
......
......@@ -57,12 +57,7 @@ export function isRootImmediateHook(name: string) {
return PAGE_SYNC_HOOKS.indexOf(name) > -1
}
// iOS-X 和安卓一致,on_show 不参与判断,避免引入新的运行时判断,导出两份
export function isRootImmediateHookX(name: string) {
const PAGE_SYNC_HOOKS = [ON_LOAD]
return PAGE_SYNC_HOOKS.indexOf(name) > -1
}
// isRootImmediateHookX deprecated
export function isRootHook(name: string) {
return PAGE_HOOKS.indexOf(name) > -1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册