From b7bf2512548be7d5d4084e1f4dff9e9663e55983 Mon Sep 17 00:00:00 2001 From: Utopia Date: Wed, 29 Oct 2025 11:07:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=20definePage=20=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=89=A9=E5=B1=95=E4=B8=80=E4=BA=9B=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E9=A1=B9=E7=9B=AE=E4=B8=AD=E7=89=B9=E5=AE=9A=E7=9A=84?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/typings.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/typings.d.ts b/src/typings.d.ts index e427177..c27a7ae 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -30,6 +30,31 @@ declare global { } } +// 扩展 @uni-helper/vite-plugin-uni-pages 的 definePage 参数类型 +declare module '@uni-helper/vite-plugin-uni-pages' { + interface UserPageMeta { + /** + * 使用 type: "home" 属性设置首页,其他页面不需要设置,默认为page + * + * 尽量保证一个项目 只有一个 这个配置,如果有多个,会按照字母顺序来排列,最终可能不是您想要的效果。 + */ + type?: 'home' + /** + * 页面布局类型, 模板默认只有 default, 如果在 src/layouts 下新增了 layout, 可以扩展当前属性 + * @default 'default' + * + * 当前属性供 https://github.com/uni-helper/vite-plugin-uni-layouts 插件使用 + */ + layout?: 'default' + /** + * 是否从需要登录的路径中排除 + * + * 登录授权(可选):跟以前的 needLogin 类似功能,但是同时支持黑白名单,详情请见 src/router 文件夹 + */ + excludeLoginPath?: boolean + } +} + // patch uni 类型 // 1. 补全 uni.hideToast() 的 options 类型 // 2. 补全 uni.hideLoading() 的 options 类型