How to emit a method defined at child component by RouterView? #1890
Unanswered
Astrian
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am writing a gamepad-supported app with VueRouter, and I need to make the D-Pad navigation available between different components.
In my project, the
App.vue
file will have a navigation bar and can be navigated by the left and the right button on D-Pad. In my mind, when the user presses the down button, the cursor will focus on the element inside theRouterView
.I want to process all gamepad button press on
App.vue
rather than the component can be called byRouterView
, so I need to pass an event to the child. However, theref
cannot be used inRouterView
.So is there any method to emit the event in the child component in RouterView? Or is there any better workaround or solution?
Beta Was this translation helpful? Give feedback.
All reactions