@@ -8,13 +8,7 @@ import type { Component } from 'vue';
88import type { BaseFormComponentType } from '@vben/common-ui' ;
99import type { Recordable } from '@vben/types' ;
1010
11- import {
12- defineAsyncComponent ,
13- defineComponent ,
14- getCurrentInstance ,
15- h ,
16- ref ,
17- } from 'vue' ;
11+ import { defineAsyncComponent , defineComponent , h , ref } from 'vue' ;
1812
1913import { ApiComponent , globalShareState , IconPicker } from '@vben/common-ui' ;
2014import { $t } from '@vben/locales' ;
@@ -82,16 +76,24 @@ const withDefaultPlaceholder = <T extends Component>(
8276 $t ( `ui.placeholder.${ type } ` ) ;
8377 // 透传组件暴露的方法
8478 const innerRef = ref ( ) ;
85- const publicApi : Recordable < any > = { } ;
86- expose ( publicApi ) ;
87- const instance = getCurrentInstance ( ) ;
88- instance ?. proxy ?. $nextTick ( ( ) => {
89- for ( const key in innerRef . value ) {
90- if ( typeof innerRef . value [ key ] === 'function' ) {
91- publicApi [ key ] = innerRef . value [ key ] ;
92- }
93- }
94- } ) ;
79+ // const publicApi: Recordable<any> = {};
80+ expose (
81+ new Proxy (
82+ { } ,
83+ {
84+ get : ( _target , key ) => innerRef . value ?. [ key ] ,
85+ has : ( _target , key ) => key in ( innerRef . value || { } ) ,
86+ } ,
87+ ) ,
88+ ) ;
89+ // const instance = getCurrentInstance();
90+ // instance?.proxy?.$nextTick(() => {
91+ // for (const key in innerRef.value) {
92+ // if (typeof innerRef.value[key] === 'function') {
93+ // publicApi[key] = innerRef.value[key];
94+ // }
95+ // }
96+ // });
9597 return ( ) =>
9698 h (
9799 component ,
0 commit comments