You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Child component defineExpose methods out of the third party component, the parent component ref cannot trigger the child component exposed methods, when the child component is wrapped in the outermost div
#11920
Closed
GG-BOYcai opened this issue
Sep 13, 2024
· 3 comments
Click btn2, the parent component will trigger the focus method of the child component (when the child component my-button is not wrapped by div), but when the child component is wrapped by div, the parent component cannot trigger the focus method of the child component
What is expected?
{{ title }}:
The parent component can then trigger the child component's methods
What is actually happening?
A parent component cannot trigger a child component's method
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered:
It can't reproduce. please confirm your reproduction.
There is no problem with this submission.
and the specific operation and performance are as follows: clicking btn2 will trigger the focus method of the sub-component a-button. At this time, the performance is that the query button will focus, but the current click does not focus, which is a problem; When you remove the outermost div of the subcomponent my-button, click btn2 and the query button will focus.
The question is why clicking btn2 does not trigger the method of the child component when the outermost layer of the child component is wrapped by div
@GG-BOYcai
I can't reproduce it with your reproduction. Please confirm your reproduction can directly reproduce your problem without any change require.
Vue version
3.4.29
Link to minimal reproduction
https://github.com/GG-BOYcai/test/tree/master
Steps to reproduce
Click btn2, the parent component will trigger the focus method of the child component (when the child component my-button is not wrapped by div), but when the child component is wrapped by div, the parent component cannot trigger the focus method of the child component
What is expected?
What is actually happening?
A parent component cannot trigger a child component's method
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: