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 71133647c..f1ab1016d 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'; @@ -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-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue b/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue index 6e82fc266..4577a9343 100644 --- a/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue +++ b/apps/web-antd/src/components/simple-process-design/components/nodes-config/modules/condition-dialog.vue @@ -63,7 +63,7 @@ const [Modal, modalApi] = useVbenModal({ }); // TODO xingyu 暴露 modalApi 给父组件是否合适? trigger-node-config.vue 会有多个 conditionDialog 实例 -// 不用暴露啊,用 useVbenModal 就可以了 +// TODO @jason:回复 from xingyu:不用暴露啊,用 useVbenModal 就可以了 defineExpose({ modalApi });