diff --git a/RouterApi/src/main/ets/annotation/Route.ts b/RouterApi/src/main/ets/annotation/Route.ts index 90016ca7230d7f1960a2b246967d93909549158f..6b557feb9867f7f2e372251030a172d88b35609f 100644 --- a/RouterApi/src/main/ets/annotation/Route.ts +++ b/RouterApi/src/main/ets/annotation/Route.ts @@ -56,4 +56,5 @@ interface Param { */ needLogin?: boolean extra?: string + param?: Record } diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 index b2ac5a0c458b572da57b3bb04c2e102c3bb96c10..dcaa849a14f1bd824477d1e7460fe9fa5556514f 100644 --- a/hvigor/hvigor-config.json5 +++ b/hvigor/hvigor-config.json5 @@ -2,7 +2,8 @@ "modelVersion": "5.0.0", "dependencies": { // "router-register-plugin":"file:../plugins/router-register-plugin-1.5.0.tgz" - "router-register-plugin":"1.5.0" +// "router-register-plugin":"1.5.0" + "router-register-plugin":"file:../libs/router-register-plugin-1.5.7.tgz" }, "execution": { // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ diff --git a/libs/router-register-plugin-1.5.7.tgz b/libs/router-register-plugin-1.5.7.tgz new file mode 100644 index 0000000000000000000000000000000000000000..c247a29028803afcfea2702cfe81e78560f1209c Binary files /dev/null and b/libs/router-register-plugin-1.5.7.tgz differ diff --git a/products/entry/src/main/ets/pages/Index.ets b/products/entry/src/main/ets/pages/Index.ets index 32e729470a88ea5051706e1cb5541afc8ef279cf..b810f4276e9d06a5c9ed7902cf8713983ceccf90 100644 --- a/products/entry/src/main/ets/pages/Index.ets +++ b/products/entry/src/main/ets/pages/Index.ets @@ -77,6 +77,7 @@ struct Index { let isStarted = AppStorage.get(RouterConst.SPLASH_TAG) if (!isStarted) { ZRouter.getInstance() + .setParam(Object({ids: 1})) .setAnimate(false) .setPopListener((r) => { console.log('Index setPopListener', r) diff --git a/products/entry/src/main/ets/pages/SplashPage.ets b/products/entry/src/main/ets/pages/SplashPage.ets index 3a1a1ef19b0c04e72c5f4259ff6369cca81dfd3d..09aca75562dab16f01c831efc8d255ae1dd3db58 100644 --- a/products/entry/src/main/ets/pages/SplashPage.ets +++ b/products/entry/src/main/ets/pages/SplashPage.ets @@ -6,14 +6,22 @@ import { RouterConst } from '../constants/RouterConst'; * @date: 2024/10/12 * @desc: 如果@Route不设置任何属性,则默认使用类名作为路由名称 */ -@Route +@Route({ + param: { + "ids": { + default: -1 + } + } +}) @Component export struct SplashPage { + @State ids: number = -1 @State countdown: number = 3000 build() { NavDestination() { Column() { + Text("测试id参数=" + this.ids) Text('欢迎使用ZRouter') .fontColor(Color.Black) .textAlign(TextAlign.Center)