diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs index 94b0192a..2a5a5a1a 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs @@ -15,6 +15,6 @@ export default { ], 'package.json': ['prettier --cache --write'], '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': [ - 'prettier --cache --write--parser json', + 'prettier --cache --write --parser json', ], }; diff --git a/.node-version b/.node-version index 48b14e6b..ee5c2446 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -20.14.0 +22.1.0 diff --git a/.vscode/settings.json b/.vscode/settings.json index bb2590be..82f3257a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,7 +14,7 @@ "editor.tabSize": 2, "editor.detectIndentation": false, "editor.cursorBlinking": "expand", - "editor.largeFileOptimizations": false, + "editor.largeFileOptimizations": true, "editor.accessibilitySupport": "off", "editor.cursorSmoothCaretAnimation": "on", "editor.guides.bracketPairs": "active", @@ -91,6 +91,7 @@ "**/bower_components": true, "**/.turbo": true, "**/.idea": true, + "**/.vitepress": true, "**/tmp": true, "**/.git": true, "**/.svn": true, @@ -113,6 +114,8 @@ "**/yarn.lock": true }, + "typescript.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo"], + // search "search.searchEditor.singleClickBehaviour": "peekDefinition", "search.followSymlinks": false, diff --git a/README.ja-JP.md b/README.ja-JP.md index a8a75311..f7847a1d 100644 --- a/README.ja-JP.md +++ b/README.ja-JP.md @@ -1,8 +1,13 @@ -
VbenAdmin Logo

+
+ + VbenAdmin Logo + +
+
[![license](https://img.shields.io/github/license/anncwb/vue-vben-admin.svg)](LICENSE) -

Vue Vben Admin

+

Vue Vben Admin

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vbenjs_vue-vben-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vbenjs_vue-vben-admin) ![codeql](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml/badge.svg) ![build](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml/badge.svg) ![ci](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml/badge.svg) ![deploy](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml/badge.svg) @@ -15,27 +20,27 @@ Vue Vben Adminは、最新の`vue3`、`vite`、`TypeScript`などの主流技術 ## アップグレード通知 -これは最新バージョン5.0であり、以前のバージョンとは互換性がありません。新しいプロジェクトを開始する場合は、最新バージョンを使用することをお勧めします。古いバージョンを表示したい場合は、[v2ブランチ](https://github.com/vbenjs/vue-vben-admin/tree/v2)を使用してください。 +これは最新バージョン `5.0` であり、以前のバージョンとは互換性がありません。新しいプロジェクトを開始する場合は、最新バージョンを使用することをお勧めします。古いバージョンを表示したい場合は、[v2ブランチ](https://github.com/vbenjs/vue-vben-admin/tree/v2)を使用してください。 ## 特徴 -- **最新技術スタック**: Vue 3やViteなどの最先端フロントエンド技術で開発 -- **TypeScript**: アプリケーション規模のJavaScriptのための言語 -- **テーマ**: 複数のテーマカラーが利用可能で、カスタマイズオプションも豊富 -- **国際化**: 完全な内蔵国際化サポート -- **権限管理**: 動的ルートベースの権限生成ソリューションを内蔵 +- **最新技術スタック**:Vue 3やViteなどの最先端フロントエンド技術で開発 +- **TypeScript**:アプリケーション規模のJavaScriptのための言語 +- **テーマ**:複数のテーマカラーが利用可能で、カスタマイズオプションも豊富 +- **国際化**:完全な内蔵国際化サポート +- **権限管理**:動的ルートベースの権限生成ソリューションを内蔵 ## プレビュー - [Vben Admin](https://vben.pro/) - フルバージョンの中国語サイト -テストアカウント: vben/123456 +テストアカウント:vben/123456 -

- VbenAdmin Logo - VbenAdmin Logo - VbenAdmin Logo -

+
+ VbenAdmin Logo + VbenAdmin Logo + VbenAdmin Logo +
### Gitpodを使用 @@ -49,30 +54,27 @@ Gitpod(GitHub用の無料オンライン開発環境)でプロジェクト ## インストールと使用 -- プロジェクトコードを取得 +1. プロジェクトコードを取得 ```bash git clone https://github.com/vbenjs/vue-vben-admin.git ``` -- 依存関係のインストール +2. 依存関係のインストール ```bash cd vue-vben-admin - npm i -g corepack - pnpm install - ``` -- 実行 +3. 実行 ```bash pnpm dev ``` -- ビルド +4. ビルド ```bash pnpm build @@ -86,40 +88,39 @@ pnpm build ご参加をお待ちしております![Issueを提出](https://github.com/anncwb/vue-vben-admin/issues/new/choose)するか、Pull Requestを送信してください。 -**Pull Request:** +**Pull Request プロセス:** -1. コードをフォーク! -2. 自分のブランチを作成: `git checkout -b feat/xxxx` -3. 変更をコミット: `git commit -am 'feat(function): add xxxxx'` -4. ブランチをプッシュ: `git push origin feat/xxxx` +1. コードをフォーク +2. 自分のブランチを作成:`git checkout -b feat/xxxx` +3. 変更をコミット:`git commit -am 'feat(function): add xxxxx'` +4. ブランチをプッシュ:`git push origin feat/xxxx` 5. `pull request`を送信 ## Git貢献提出規則 -- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 規則 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) +参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 規則 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) - - `feat` 新機能の追加 - - `fix` 問題/バグの修正 - - `style` コードスタイルに関連し、実行結果に影響しない - - `perf` 最適化/パフォーマンス向上 - - `refactor` リファクタリング - - `revert` 変更の取り消し - - `test` テスト関連 - - `docs` ドキュメント/注釈 - - `chore` 依存関係の更新/スキャフォールディング設定の変更など - - `ci` 継続的インテグレーション - - `types` 型定義ファイルの変更 - - `wip` 開発中 +- `feat` 新機能の追加 +- `fix` 問題/バグの修正 +- `style` コードスタイルに関連し、実行結果に影響しない +- `perf` 最適化/パフォーマンス向上 +- `refactor` リファクタリング +- `revert` 変更の取り消し +- `test` テスト関連 +- `docs` ドキュメント/注釈 +- `chore` 依存関係の更新/スキャフォールディング設定の変更など +- `ci` 継続的インテグレーション +- `types` 型定義ファイルの変更 ## ブラウザサポート -ローカル開発には`Chrome 80+`ブラウザを推奨します +ローカル開発には `Chrome 80+` ブラウザを推奨します モダンブラウザをサポートし、IEはサポートしません -| [ Edge](http://godban.github.io/browsers-support-badges/)
IE | [ Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| :-: | :-: | :-: | :-: | :-: | -| サポートしない | 最新2バージョン | 最新2バージョン | 最新2バージョン | 最新2バージョン | +| [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| :-: | :-: | :-: | :-: | +| 最新2バージョン | 最新2バージョン | 最新2バージョン | 最新2バージョン | ## メンテナー @@ -140,8 +141,7 @@ pnpm build ## 貢献者 - Contributors + Contributors ## Discord diff --git a/README.md b/README.md index 0a997f5a..e027949a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ -
VbenAdmin Logo

+
+ + VbenAdmin Logo + +
+
[![license](https://img.shields.io/github/license/anncwb/vue-vben-admin.svg)](LICENSE) -

Vue Vben Admin

+

Vue Vben Admin

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vbenjs_vue-vben-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vbenjs_vue-vben-admin) ![codeql](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml/badge.svg) ![build](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml/badge.svg) ![ci](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml/badge.svg) ![deploy](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml/badge.svg) @@ -17,7 +22,7 @@ Vue Vben Admin is a free and open source middle and back-end template. Using the This is the latest version, 5.0, and it is not compatible with previous versions. If you are starting a new project, it is recommended to use the latest version. If you wish to view the old version, please use the [v2 branch](https://github.com/vbenjs/vue-vben-admin/tree/v2). -## Feature +## Features - **Latest Technology Stack**: Developed with cutting-edge front-end technologies like Vue 3 and Vite - **TypeScript**: A language for application-scale JavaScript @@ -31,11 +36,11 @@ This is the latest version, 5.0, and it is not compatible with previous versions Test Account: vben/123456 -

- VbenAdmin Logo - VbenAdmin Logo - VbenAdmin Logo -

+
+ VbenAdmin Logo + VbenAdmin Logo + VbenAdmin Logo +
### Use Gitpod @@ -47,31 +52,29 @@ Open the project in Gitpod (free online dev environment for GitHub) and start co [Document](https://doc.vben.pro/) -## Install and use +## Install and Use -- Get the project code +1. Get the project code ```bash git clone https://github.com/vbenjs/vue-vben-admin.git ``` -- Installation dependencies +2. Install dependencies ```bash cd vue-vben-admin - npm i -g corepack - pnpm install ``` -- run +3. Run ```bash pnpm dev ``` -- build +4. Build ```bash pnpm build @@ -81,44 +84,43 @@ pnpm build [CHANGELOG](https://github.com/vbenjs/vue-vben-admin/releases) -## How to contribute +## How to Contribute -You are very welcome to join![Raise an issue](https://github.com/anncwb/vue-vben-admin/issues/new/choose) Or submit a Pull Request。 +You are very welcome to join! [Raise an issue](https://github.com/anncwb/vue-vben-admin/issues/new/choose) or submit a Pull Request. -**Pull Request:** +**Pull Request Process:** -1. Fork code! -2. Create your own branch: `git checkout -b feat/xxxx` +1. Fork the code +2. Create your branch: `git checkout -b feat/xxxx` 3. Submit your changes: `git commit -am 'feat(function): add xxxxx'` 4. Push your branch: `git push origin feat/xxxx` -5. submit`pull request` +5. Submit `pull request` -## Git Contribution submission specification +## Git Contribution Submission Specification -- reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) +Reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) - - `feat` Add new features - - `fix` Fix the problem/BUG - - `style` The code style is related and does not affect the running result - - `perf` Optimization/performance improvement - - `refactor` Refactor - - `revert` Undo edit - - `test` Test related - - `docs` Documentation/notes - - `chore` Dependency update/scaffolding configuration modification etc. - - `ci` Continuous integration - - `types` Type definition file changes - - `wip` In development +- `feat` Add new features +- `fix` Fix the problem/BUG +- `style` The code style is related and does not affect the running result +- `perf` Optimization/performance improvement +- `refactor` Refactor +- `revert` Undo edit +- `test` Test related +- `docs` Documentation/notes +- `chore` Dependency update/scaffolding configuration modification etc. +- `ci` Continuous integration +- `types` Type definition file changes -## Browser support +## Browser Support The `Chrome 80+` browser is recommended for local development Support modern browsers, not IE -| [ Edge](http://godban.github.io/browsers-support-badges/)
IE | [ Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| :-: | :-: | :-: | :-: | :-: | -| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions | +| [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| :-: | :-: | :-: | :-: | +| last 2 versions | last 2 versions | last 2 versions | last 2 versions | ## Maintainer @@ -136,11 +138,10 @@ If you think this project is helpful to you, you can help the author buy a cup o Paypal Me -## Contributor +## Contributors - Contributors + Contributors ## Discord diff --git a/README.zh-CN.md b/README.zh-CN.md index c7c577f2..2585dfee 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -76,7 +76,7 @@ admin 账号: admin admin123 git clone https://gitee.com/dapppp/ruoyi-plus-vben5.git ``` -- 安装依赖 +2. 安装依赖 ```bash cd ruoyi-plus-vben5 @@ -150,7 +150,7 @@ VITE_GLOB_WEBSOCKET_ENABLE=false pnpm dev:antd ``` -- 打包 +4. 打包 ```bash pnpm build:antd @@ -164,21 +164,21 @@ pnpm build:antd ## Git 贡献提交规范 -- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) +参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) - - `feat` 增加新功能 - - `fix` 修复问题/BUG - - `style` 代码风格相关无影响运行结果的 - - `perf` 优化/性能提升 - - `refactor` 重构 - - `revert` 撤销修改 - - `test` 测试相关 - - `docs` 文档/注释 - - `chore` 依赖更新/脚手架配置修改等 - - `workflow` 工作流改进 - - `ci` 持续集成 - - `types` 类型定义文件更改 - - `wip` 开发中 +- `feat` 增加新功能 +- `fix` 修复问题/BUG +- `style` 代码风格相关无影响运行结果的 +- `perf` 优化/性能提升 +- `refactor` 重构 +- `revert` 撤销修改 +- `test` 测试相关 +- `docs` 文档/注释 +- `chore` 依赖更新/脚手架配置修改等 +- `workflow` 工作流改进 +- `ci` 持续集成 +- `types` 类型定义文件更改 +- `wip` 开发中 ## 浏览器支持 @@ -186,7 +186,7 @@ pnpm build:antd 本地开发推荐使用`Chrome` 最新版本浏览器 -支持现代浏览器, 不支持 IE +支持现代浏览器,不支持 IE | [ Edge](http://godban.github.io/browsers-support-badges/)
IE | [ Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | | :-: | :-: | :-: | :-: | :-: | diff --git a/internal/vite-config/src/typing.ts b/internal/vite-config/src/typing.ts index 31683cc7..f730bdb9 100644 --- a/internal/vite-config/src/typing.ts +++ b/internal/vite-config/src/typing.ts @@ -3,149 +3,328 @@ import type { ConfigEnv, PluginOption, UserConfig } from 'vite'; import type { PluginOptions } from 'vite-plugin-dts'; import type { Options as PwaPluginOptions } from 'vite-plugin-pwa'; +/** + * ImportMap 配置接口 + * @description 用于配置模块导入映射,支持自定义导入路径和范围 + * @example + * ```typescript + * { + * imports: { + * 'vue': 'https://unpkg.com/vue@3.2.47/dist/vue.esm-browser.js' + * }, + * scopes: { + * 'https://site.com/': { + * 'vue': 'https://unpkg.com/vue@3.2.47/dist/vue.esm-browser.js' + * } + * } + * } + * ``` + */ interface IImportMap { + /** 模块导入映射 */ imports?: Record; + /** 作用域特定的导入映射 */ scopes?: { [scope: string]: Record; }; } + +/** + * 打印插件配置选项 + * @description 用于配置控制台打印信息 + */ interface PrintPluginOptions { /** - * 打印的数据 + * 打印的数据映射 + * @description 键值对形式的数据,将在控制台打印 + * @example + * ```typescript + * { + * 'App Version': '1.0.0', + * 'Build Time': '2024-01-01' + * } + * ``` */ infoMap?: Record; } +/** + * Nitro Mock 插件配置选项 + * @description 用于配置 Nitro Mock 服务器的行为 + */ interface NitroMockPluginOptions { /** - * mock server 包名 + * Mock 服务器包名 + * @default '@vbenjs/nitro-mock' */ mockServerPackage?: string; /** - * mock 服务端口 + * Mock 服务端口 + * @default 3000 */ port?: number; /** - * mock 日志是否打印 + * 是否打印 Mock 日志 + * @default false */ verbose?: boolean; } +/** + * 归档插件配置选项 + * @description 用于配置构建产物的压缩归档 + */ interface ArchiverPluginOptions { /** * 输出文件名 - * @default dist + * @default 'dist' */ name?: string; /** * 输出目录 - * @default . + * @default '.' */ outputDir?: string; } /** - * importmap 插件配置 + * ImportMap 插件配置 + * @description 用于配置模块的 CDN 导入 */ interface ImportmapPluginOptions { /** * CDN 供应商 - * @default jspm.io + * @default 'jspm.io' + * @description 支持 esm.sh 和 jspm.io 两种 CDN 供应商 */ defaultProvider?: 'esm.sh' | 'jspm.io'; - /** importmap 配置 */ + /** + * ImportMap 配置数组 + * @description 配置需要从 CDN 导入的包 + * @example + * ```typescript + * [ + * { name: 'vue' }, + * { name: 'pinia', range: '^2.0.0' } + * ] + * ``` + */ importmap?: Array<{ name: string; range?: string }>; - /** 手动配置importmap */ + /** + * 手动配置 ImportMap + * @description 自定义 ImportMap 配置 + */ inputMap?: IImportMap; } /** - * 用于判断是否需要加载插件 + * 条件插件配置 + * @description 用于根据条件动态加载插件 */ interface ConditionPlugin { - // 判断条件 + /** + * 判断条件 + * @description 当条件为 true 时加载插件 + */ condition?: boolean; - // 插件对象 + /** + * 插件对象 + * @description 返回插件数组或 Promise + */ plugins: () => PluginOption[] | PromiseLike; } +/** + * 通用插件配置选项 + * @description 所有插件共用的基础配置 + */ interface CommonPluginOptions { - /** 是否开启devtools */ + /** + * 是否开启开发工具 + * @default false + */ devtools?: boolean; - /** 环境变量 */ + /** + * 环境变量 + * @description 自定义环境变量 + */ env?: Record; - /** 是否注入metadata */ + /** + * 是否注入元数据 + * @default true + */ injectMetadata?: boolean; - /** 是否构建模式 */ + /** + * 是否为构建模式 + * @default false + */ isBuild?: boolean; - /** 构建模式 */ + /** + * 构建模式 + * @default 'development' + */ mode?: string; - /** 开启依赖分析 */ + /** + * 是否开启依赖分析 + * @default false + * @description 使用 rollup-plugin-visualizer 分析依赖 + */ visualizer?: boolean | PluginVisualizerOptions; } +/** + * 应用插件配置选项 + * @description 用于配置应用构建时的插件选项 + */ interface ApplicationPluginOptions extends CommonPluginOptions { - /** 开启后,会在打包dist同级生成dist.zip */ + /** + * 是否开启压缩归档 + * @default false + * @description 开启后会在打包目录生成 zip 文件 + */ archiver?: boolean; - /** 压缩归档插件配置 */ + /** + * 压缩归档插件配置 + * @description 配置压缩归档的行为 + */ archiverPluginOptions?: ArchiverPluginOptions; - /** 开启 gzip|brotli 压缩 */ + /** + * 是否开启压缩 + * @default false + * @description 支持 gzip 和 brotli 压缩 + */ compress?: boolean; - /** 压缩类型 */ + /** + * 压缩类型 + * @default ['gzip'] + * @description 可选的压缩类型 + */ compressTypes?: ('brotli' | 'gzip')[]; - /** 在构建的时候抽离配置文件 */ + /** + * 是否抽离配置文件 + * @default false + * @description 在构建时抽离配置文件 + */ extraAppConfig?: boolean; - /** 是否开启html插件 */ + /** + * 是否开启 HTML 插件 + * @default true + */ html?: boolean; - /** 是否开启i18n */ + /** + * 是否开启国际化 + * @default false + */ i18n?: boolean; - /** 是否开启 importmap CDN */ + /** + * 是否开启 ImportMap CDN + * @default false + */ importmap?: boolean; - /** importmap 插件配置 */ + /** + * ImportMap 插件配置 + */ importmapOptions?: ImportmapPluginOptions; - /** 是否注入app loading */ + /** + * 是否注入应用加载动画 + * @default true + */ injectAppLoading?: boolean; - /** 是否注入全局scss */ + /** + * 是否注入全局 SCSS + * @default true + */ injectGlobalScss?: boolean; - /** 是否注入版权信息 */ + /** + * 是否注入版权信息 + * @default true + */ license?: boolean; - /** 是否开启nitro mock */ + /** + * 是否开启 Nitro Mock + * @default false + */ nitroMock?: boolean; - /** nitro mock 插件配置 */ + /** + * Nitro Mock 插件配置 + */ nitroMockOptions?: NitroMockPluginOptions; - /** 开启控制台自定义打印 */ + /** + * 是否开启控制台打印 + * @default false + */ print?: boolean; - /** 打印插件配置 */ + /** + * 打印插件配置 + */ printInfoMap?: PrintPluginOptions['infoMap']; - /** 是否开启pwa */ + /** + * 是否开启 PWA + * @default false + */ pwa?: boolean; - /** pwa 插件配置 */ + /** + * PWA 插件配置 + */ pwaOptions?: Partial; - /** 是否开启vxe-table懒加载 */ + /** + * 是否开启 VXE Table 懒加载 + * @default false + */ vxeTableLazyImport?: boolean; } +/** + * 库插件配置选项 + * @description 用于配置库构建时的插件选项 + */ interface LibraryPluginOptions extends CommonPluginOptions { - /** 开启 dts 输出 */ + /** + * 是否开启 DTS 输出 + * @default true + * @description 生成 TypeScript 类型声明文件 + */ dts?: boolean | PluginOptions; } +/** + * 应用配置选项类型 + */ type ApplicationOptions = ApplicationPluginOptions; +/** + * 库配置选项类型 + */ type LibraryOptions = LibraryPluginOptions; +/** + * 应用配置定义函数类型 + * @description 用于定义应用构建配置 + */ type DefineApplicationOptions = (config?: ConfigEnv) => Promise<{ + /** 应用插件配置 */ application?: ApplicationOptions; + /** Vite 配置 */ vite?: UserConfig; }>; +/** + * 库配置定义函数类型 + * @description 用于定义库构建配置 + */ type DefineLibraryOptions = (config?: ConfigEnv) => Promise<{ + /** 库插件配置 */ library?: LibraryOptions; + /** Vite 配置 */ vite?: UserConfig; }>; +/** + * 配置定义类型 + * @description 应用或库的配置定义 + */ type DefineConfig = DefineApplicationOptions | DefineLibraryOptions; export type { diff --git a/package.json b/package.json index 8f7f41d7..c0a2792c 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "node": ">=20.10.0", "pnpm": ">=9.12.0" }, - "packageManager": "pnpm@9.15.9", + "packageManager": "pnpm@10.10.0", "pnpm": { "peerDependencyRules": { "allowedVersions": { diff --git a/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts b/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts index a7b8ef41..9383064c 100644 --- a/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts +++ b/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts @@ -2,13 +2,18 @@ import type { FormRenderProps } from '../types'; import { computed, nextTick, onMounted, ref, useTemplateRef, watch } from 'vue'; -import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'; +import { + breakpointsTailwind, + useBreakpoints, + useElementVisibility, +} from '@vueuse/core'; /** * 动态计算行数 */ export function useExpandable(props: FormRenderProps) { const wrapperRef = useTemplateRef('wrapperRef'); + const isVisible = useElementVisibility(wrapperRef); const rowMapping = ref>({}); // 是否已经计算过一次 const isCalculated = ref(false); @@ -31,6 +36,7 @@ export function useExpandable(props: FormRenderProps) { () => props.showCollapseButton, () => breakpoints.active().value, () => props.schema?.length, + () => isVisible.value, ], async ([val]) => { if (val) { diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue index 7a28dddd..25069979 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue @@ -82,17 +82,17 @@ const { zIndex, } = usePriorityValues(props, state); -watch( - () => showLoading.value, - (v) => { - if (v && wrapperRef.value) { - wrapperRef.value.scrollTo({ - // behavior: 'smooth', - top: 0, - }); - } - }, -); +// watch( +// () => showLoading.value, +// (v) => { +// if (v && wrapperRef.value) { +// wrapperRef.value.scrollTo({ +// // behavior: 'smooth', +// top: 0, +// }); +// } +// }, +// ); function interactOutside(e: Event) { if (!closeOnClickModal.value || submitting.value) { @@ -266,19 +266,13 @@ const getForceMount = computed(() => { ref="wrapperRef" :class=" cn('relative flex-1 overflow-y-auto p-3', contentClass, { - 'overflow-hidden': showLoading, + 'pointer-events-none': showLoading || submitting, }) " > - -
- + -
- +