jsx-vue2 icon indicating copy to clipboard operation
jsx-vue2 copied to clipboard

无法在vue2.7的中使用ref获取dom,以及组件实例。

Open jetBn opened this issue 2 years ago • 4 comments

jetBn avatar Jul 14 '22 10:07 jetBn

image image

jetBn avatar Jul 14 '22 10:07 jetBn

image

jetBn avatar Jul 14 '22 10:07 jetBn

如果需要手动赋值 ref 的话,使用函数的形式赋值

<SwitchSettingCommonModal ref="(el)=>{modalRef.value = el}" />

nooooooom avatar Aug 04 '22 09:08 nooooooom

如果需要手动赋值 ref 的话,使用函数的形式赋值

<SwitchSettingCommonModal ref="(el)=>{modalRef.value = el}" />

可行的, 不过实例代码应该是这样<SwitchSettingCommonModal ref={el=>(modalRef.value = el)} />

i-ce-fish avatar Dec 05 '23 02:12 i-ce-fish