vuetifyのv-treeviewで、nodeごとにopen-on-clickのtrue/falseを設定する方法が知りたいです。
デフォルトで開きたいわけではなく、クリックしたときにnodeを開きたいです。
下記コードでいうと、id:19はnode全体をクリックすれば開き、id:20は左端の「▼」をクリックしないと開かないという設定をしたいというのが今回の要件です。
js
1<template> 2 <v-treeview :items="items" open-on-click></v-treeview> 3</template> 4 5<script> 6 export default { 7 data: () => ({ 8 items: [ 9 { 10 id: 19, // open-on-clickをtrueにしたい 11 name: 'Videos :', 12 children: [ 13 { 14 id: 20, // open-on-clickをfalseにしたい 15 name: 'Tutorials :', 16 children: [ 17 { id: 21, name: 'Basic layouts : mp4' }, 18 { id: 22, name: 'Advanced techniques : mp4' }, 19 { id: 23, name: 'All about app : dir' }, 20 ], 21 }, 22 { id: 24, name: 'Intro : mov' }, 23 { id: 25, name: 'Conference introduction : avi' }, 24 ], 25 }, 26 ] 27</script>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/06/28 02:47
2022/06/28 04:13
2022/06/28 06:20