Closed ksh033 closed 2 months ago
Vue 控件属性指定 ref,x-component-props={ref:"xxxx"}
$refs有xxx控件实例出现
$refs空
@formily/vue@2.3.2
是否可以在ReactiveField.ts文件支持ref属性 const componentData = { attrs: { disabled: !isVoidField(field) ? field.pattern === 'disabled' || field.pattern === 'readPretty' : undefined, readOnly: !isVoidField(field) ? field.pattern === 'readOnly' : undefined, ...originData, value: !isVoidField(field) ? field.value : undefined, }, style: originData?.style, class: originData?.class, ref: originData?.ref, on: events, } delete componentData.attrs.style delete componentData.attrs.class
现在就是支持的,可以使用 函数,或带value的对象
@yiyunwan 怎么写呢?有没 json-schema 的例子。文档内没找到ref的资料。 ,我是用了 json-schema 的写法,schema组件的属性只能用 x-component-props={ref:"table"},这个属性的传参又是通过ReactiveField,ReactiveField又没传ref给组件。
Reproduction link
Steps to reproduce
Vue 控件属性指定 ref,x-component-props={ref:"xxxx"}
What is expected?
$refs有xxx控件实例出现
What is actually happening?
$refs空
Package
@formily/vue@2.3.2
是否可以在ReactiveField.ts文件支持ref属性 const componentData = { attrs: { disabled: !isVoidField(field) ? field.pattern === 'disabled' || field.pattern === 'readPretty' : undefined, readOnly: !isVoidField(field) ? field.pattern === 'readOnly' : undefined, ...originData, value: !isVoidField(field) ? field.value : undefined, }, style: originData?.style, class: originData?.class, ref: originData?.ref, on: events, } delete componentData.attrs.style delete componentData.attrs.class