diff --git a/.github/contributing.md b/.github/contributing.md index f22370f3b..304c51926 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -19,11 +19,9 @@ Project maintainers have the right and responsibility to remove, edit, or reject - Checkout a topic branch from the relevant branch, e.g. main, and merge back against that branch. - If adding a new feature: - - Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. - If fixing bug: - - Provide a detailed description of the bug in the PR. Live demo preferred. - It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging. diff --git a/apps/web-antd/src/adapter/component/index.ts b/apps/web-antd/src/adapter/component/index.ts index d452d5210..786a93dae 100644 --- a/apps/web-antd/src/adapter/component/index.ts +++ b/apps/web-antd/src/adapter/component/index.ts @@ -8,13 +8,7 @@ import type { Component } from 'vue'; import type { BaseFormComponentType } from '@vben/common-ui'; import type { Recordable } from '@vben/types'; -import { - defineAsyncComponent, - defineComponent, - getCurrentInstance, - h, - ref, -} from 'vue'; +import { defineAsyncComponent, defineComponent, h, ref } from 'vue'; import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui'; import { $t } from '@vben/locales'; @@ -82,16 +76,15 @@ const withDefaultPlaceholder = ( $t(`ui.placeholder.${type}`); // 透传组件暴露的方法 const innerRef = ref(); - const publicApi: Recordable = {}; - expose(publicApi); - const instance = getCurrentInstance(); - instance?.proxy?.$nextTick(() => { - for (const key in innerRef.value) { - if (typeof innerRef.value[key] === 'function') { - publicApi[key] = innerRef.value[key]; - } - } - }); + expose( + new Proxy( + {}, + { + get: (_target, key) => innerRef.value?.[key], + has: (_target, key) => key in (innerRef.value || {}), + }, + ), + ); return () => h( component, diff --git a/apps/web-ele/src/adapter/component/index.ts b/apps/web-ele/src/adapter/component/index.ts index e2f533cf5..79a463602 100644 --- a/apps/web-ele/src/adapter/component/index.ts +++ b/apps/web-ele/src/adapter/component/index.ts @@ -8,13 +8,7 @@ import type { Component } from 'vue'; import type { BaseFormComponentType } from '@vben/common-ui'; import type { Recordable } from '@vben/types'; -import { - defineAsyncComponent, - defineComponent, - getCurrentInstance, - h, - ref, -} from 'vue'; +import { defineAsyncComponent, defineComponent, h, ref } from 'vue'; import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui'; import { $t } from '@vben/locales'; @@ -139,16 +133,15 @@ const withDefaultPlaceholder = ( $t(`ui.placeholder.${type}`); // 透传组件暴露的方法 const innerRef = ref(); - const publicApi: Recordable = {}; - expose(publicApi); - const instance = getCurrentInstance(); - instance?.proxy?.$nextTick(() => { - for (const key in innerRef.value) { - if (typeof innerRef.value[key] === 'function') { - publicApi[key] = innerRef.value[key]; - } - } - }); + expose( + new Proxy( + {}, + { + get: (_target, key) => innerRef.value?.[key], + has: (_target, key) => key in (innerRef.value || {}), + }, + ), + ); return () => h( component, diff --git a/apps/web-naive/src/adapter/component/index.ts b/apps/web-naive/src/adapter/component/index.ts index 7ff115331..f9df20273 100644 --- a/apps/web-naive/src/adapter/component/index.ts +++ b/apps/web-naive/src/adapter/component/index.ts @@ -8,13 +8,7 @@ import type { Component } from 'vue'; import type { BaseFormComponentType } from '@vben/common-ui'; import type { Recordable } from '@vben/types'; -import { - defineAsyncComponent, - defineComponent, - getCurrentInstance, - h, - ref, -} from 'vue'; +import { defineAsyncComponent, defineComponent, h, ref } from 'vue'; import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui'; import { $t } from '@vben/locales'; @@ -85,16 +79,15 @@ const withDefaultPlaceholder = ( $t(`ui.placeholder.${type}`); // 透传组件暴露的方法 const innerRef = ref(); - const publicApi: Recordable = {}; - expose(publicApi); - const instance = getCurrentInstance(); - instance?.proxy?.$nextTick(() => { - for (const key in innerRef.value) { - if (typeof innerRef.value[key] === 'function') { - publicApi[key] = innerRef.value[key]; - } - } - }); + expose( + new Proxy( + {}, + { + get: (_target, key) => innerRef.value?.[key], + has: (_target, key) => key in (innerRef.value || {}), + }, + ), + ); return () => h( component, diff --git a/apps/web-naive/src/views/demos/form/basic.vue b/apps/web-naive/src/views/demos/form/basic.vue index fe26624cc..60702a11e 100644 --- a/apps/web-naive/src/views/demos/form/basic.vue +++ b/apps/web-naive/src/views/demos/form/basic.vue @@ -1,11 +1,13 @@ diff --git a/apps/web-naive/src/views/demos/form/modal.vue b/apps/web-naive/src/views/demos/form/modal.vue new file mode 100644 index 000000000..52e23542d --- /dev/null +++ b/apps/web-naive/src/views/demos/form/modal.vue @@ -0,0 +1,71 @@ + + diff --git a/docs/src/en/guide/project/standard.md b/docs/src/en/guide/project/standard.md index e5417ce7c..4d880c467 100644 --- a/docs/src/en/guide/project/standard.md +++ b/docs/src/en/guide/project/standard.md @@ -4,7 +4,6 @@ - If you want to contribute code to the project, please ensure your code complies with the project's coding standards. - If you are using `vscode`, you need to install the following plugins: - - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - Script code checking - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - Code formatting - [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - Word syntax checking @@ -157,7 +156,6 @@ The most effective solution is to perform Lint checks locally before committing. The project defines corresponding hooks inside `lefthook.yml`: - `pre-commit`: Runs before commit, used for code formatting and checking - - `code-workspace`: Updates VSCode workspace configuration - `lint-md`: Formats Markdown files - `lint-vue`: Formats and checks Vue files @@ -167,7 +165,6 @@ The project defines corresponding hooks inside `lefthook.yml`: - `lint-json`: Formats other JSON files - `post-merge`: Runs after merge, used for automatic dependency installation - - `install`: Runs `pnpm install` to install new dependencies - `commit-msg`: Runs during commit, used for checking commit message format diff --git a/docs/src/friend-links/index.md b/docs/src/friend-links/index.md index 84b61906f..a9dc7ccf4 100644 --- a/docs/src/friend-links/index.md +++ b/docs/src/friend-links/index.md @@ -18,7 +18,6 @@ ### 友情链接 - 在您的网站上添加我们的友情链接,链接如下: - - 名称:Vben Admin - 链接:https://www.vben.pro - 描述:Vben Admin 企业级开箱即用的中后台前端解决方案 diff --git a/docs/src/guide/project/standard.md b/docs/src/guide/project/standard.md index 12a13da3b..02fc5a91e 100644 --- a/docs/src/guide/project/standard.md +++ b/docs/src/guide/project/standard.md @@ -4,7 +4,6 @@ - 如果你想向项目贡献代码,请确保你的代码符合项目的代码规范。 - 如果你使用的是 `vscode`,需要安装以下插件: - - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - 脚本代码检查 - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - 代码格式化 - [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - 单词语法检查 @@ -157,7 +156,6 @@ git hook 一般结合各种 lint,在 git 提交代码的时候进行代码风 项目在 `lefthook.yml` 内部定义了相应的 hooks: - `pre-commit`: 在提交前运行,用于代码格式化和检查 - - `code-workspace`: 更新 VSCode 工作区配置 - `lint-md`: 格式化 Markdown 文件 - `lint-vue`: 格式化并检查 Vue 文件 @@ -167,7 +165,6 @@ git hook 一般结合各种 lint,在 git 提交代码的时候进行代码风 - `lint-json`: 格式化其他 JSON 文件 - `post-merge`: 在合并后运行,用于自动安装依赖 - - `install`: 运行 `pnpm install` 安装新依赖 - `commit-msg`: 在提交时运行,用于检查提交信息格式 diff --git a/package.json b/package.json index 72db822c2..8b87dc385 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "node": ">=20.10.0", "pnpm": ">=9.12.0" }, - "packageManager": "pnpm@10.10.0", + "packageManager": "pnpm@10.12.4", "pnpm": { "peerDependencyRules": { "allowedVersions": { diff --git a/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue b/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue index 339d96541..955ae67e3 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue @@ -287,7 +287,7 @@ defineExpose({ class="tree-node focus:ring-grass8 my-0.5 flex items-center rounded px-2 py-1 outline-none focus:ring-2" >