Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jetBn opened this issue Jul 14, 2022 · 4 comments
Open

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

jetBn opened this issue Jul 14, 2022 · 4 comments

Comments

@jetBn
Copy link

jetBn commented Jul 14, 2022

No description provided.

@jetBn
Copy link
Author

jetBn commented Jul 14, 2022

image

image

@jetBn
Copy link
Author

jetBn commented Jul 14, 2022

image

@jetBn jetBn changed the title 无法在vue2.7的中使用ref活动dom,以及组件实例。 无法在vue2.7的中使用ref获取dom,以及组件实例。 Jul 14, 2022
@nooooooom
Copy link
Contributor

nooooooom commented Aug 4, 2022

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

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

@i-ce-fish
Copy link

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants