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

How to get the ID of the focused item? #31

Closed
hirisov opened this issue Feb 12, 2023 · 1 comment
Closed

How to get the ID of the focused item? #31

hirisov opened this issue Feb 12, 2023 · 1 comment

Comments

@hirisov
Copy link

hirisov commented Feb 12, 2023

Hello,

from the https://codesandbox.io/s/events-7st2s?from-embed=&file=/src/App.vue:355-385 example we can see how to bind a custom handler to the nodeFocus event. But how can I get the ID of the element which triggered this event please? How do I know which node the user clicked on? :)

thanks, Gabor

@hirisov
Copy link
Author

hirisov commented Feb 12, 2023

Never mind, got the solution:

<script>
function nodeFocus(event) {
    console.log(event.id)
}
</script>

<template>
                <treeview :config="treeConfig" :nodes="treeNodes" @nodeFocus="nodeFocus">
                </treeview>
</template>

@hirisov hirisov closed this as completed Feb 12, 2023
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

1 participant