diff --git a/packages/uni-app-plus/src/service/framework/app/utils.ts b/packages/uni-app-plus/src/service/framework/app/utils.ts index aead19b81b7ce6fa6220f3360afedc2e947d1153..09d2db185bf6cb6faf9649213b1d1c0419291cea 100644 --- a/packages/uni-app-plus/src/service/framework/app/utils.ts +++ b/packages/uni-app-plus/src/service/framework/app/utils.ts @@ -51,7 +51,7 @@ export function initLaunchOptions({ extend(enterOptions, launchOptions) const app = getNativeApp() - const schemaLink = app.getLaunchOptionsSync() + const schemaLink = app?.getLaunchOptionsSync?.() ?? {} return extend({}, launchOptions, schemaLink) } diff --git a/packages/uni-app-plus/src/service/framework/page/setup.ts b/packages/uni-app-plus/src/service/framework/page/setup.ts index f509aeed8285a7627432fe847a6cc2bd9bbe7e52..2a82f95daaa8850d031632813d394249242e3bbe 100644 --- a/packages/uni-app-plus/src/service/framework/page/setup.ts +++ b/packages/uni-app-plus/src/service/framework/page/setup.ts @@ -75,13 +75,11 @@ export function initScope( }) Object.defineProperty(vm, '$getPageStyle', { get() { - // @ts-expect-error TODO fix types by hdx return vm.$nativePage!.getPageStyle.bind(vm.$nativePage!) }, }) Object.defineProperty(vm, '$setPageStyle', { get() { - // @ts-expect-error TODO fix types by hdx return vm.$nativePage!.setPageStyle.bind(vm.$nativePage!) }, }) diff --git a/packages/uni-app-plus/src/x/api/base/getLaunchOptionsSync.ts b/packages/uni-app-plus/src/x/api/base/getLaunchOptionsSync.ts index 19b7ad6bef7d1d02615ec7f0c3d873c915145495..18d26ebfa60aba1062c8211000b28531c63d5b83 100644 --- a/packages/uni-app-plus/src/x/api/base/getLaunchOptionsSync.ts +++ b/packages/uni-app-plus/src/x/api/base/getLaunchOptionsSync.ts @@ -18,8 +18,9 @@ export const getLaunchOptionsSync = defineSyncApi( API_GET_LAUNCH_OPTIONS_SYNC, () => { const app = getNativeApp() + const baseInfo = getLaunchOptions() - const schemaInfo = app.getLaunchOptionsSync() + const schemaInfo = app?.getLaunchOptionsSync?.() ?? {} return Object.assign({}, baseInfo, schemaInfo) } )