提交 980b8172 编写于 作者: fxy060608's avatar fxy060608

fix: types

上级 0e4efe70
......@@ -89,9 +89,9 @@ function resolveEasycom(component, easycom) {
}
// @ts-ignore
const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) =>
// post-create lifecycle registrations are noops during SSR
!vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
!vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
};
const onShow = /*#__PURE__*/ createHook(uniShared.ON_SHOW);
const onHide = /*#__PURE__*/ createHook(uniShared.ON_HIDE);
const onLaunch = /*#__PURE__*/ createHook(uniShared.ON_LAUNCH);
......
......@@ -57,9 +57,9 @@ function resolveEasycom(component, easycom) {
}
// @ts-ignore
const createHook = (lifecycle) => (hook, target = getCurrentInstance()) =>
// post-create lifecycle registrations are noops during SSR
!isInSSRComponentSetup && injectHook(lifecycle, hook, target);
const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
!isInSSRComponentSetup && injectHook(lifecycle, hook, target);
};
const onShow = /*#__PURE__*/ createHook(ON_SHOW);
const onHide = /*#__PURE__*/ createHook(ON_HIDE);
const onLaunch = /*#__PURE__*/ createHook(ON_LAUNCH);
......
......@@ -174,9 +174,10 @@ const createHook =
(
hook: T,
target: ComponentInternalInstance | null = getCurrentInstance()
): void =>
): void => {
// post-create lifecycle registrations are noops during SSR
!isInSSRComponentSetup && injectHook(lifecycle as any, hook, target)
}
export const onShow = /*#__PURE__*/ createHook<onAppShowHook | onPageShowHook>(
ON_SHOW
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册