Hi folks,
i try to make a Treeview for filter and selecting some hierarchical data.
i stuck on the click part: When i select a node, i want to emit the id of the clicked node.
i also try to add a filter, but also stuck there.
https://vuetifyjs.com/en/api/v-treeview/
Can someone give me a hint?
Current state i a template node with this content:
<template>
<v-treeview :items="items"
item-value="id"
activatable
@update:selected="send({payload: value})"
@click:select="send({payload: value})"
>
</v-treeview>
</template>
<script>
export default {
data: () => ({
items: [
{
id: 1,
title: 'Applications :',
children: [
{ id: 2, title: 'Calendar : app' },
{ id: 3, title: 'Chrome : app' },
{ id: 4, title: 'Webstorm : app' },
],
},
{
id: 5,
title: 'Documents :',
children: [
{
id: 6,
title: 'vuetify :',
children: [
{
id: 7,
title: 'src :',
children: [
{ id: 8, title: 'index : ts' },
{ id: 9, title: 'bootstrap : ts' },
],
},
],
},
],
}
],
}),
watch: {
// watch for any changes of "count"
},
computed: {
// automatically compute this variable
// whenever VueJS deems appropriate
},
methods: {
// expose a method to our <template> and Vue Application
},
mounted() {
// code here when the component is first loaded
},
unmounted() {
// code here when the component is removed from the Dashboard
// i.e. when the user navigates away from the page
}
}
</script>