Skip to content

Commit

Permalink
docs(VTreeview): change item-disabled example to use item-props
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwu9145 committed May 30, 2024
1 parent b922825 commit 5deda0a
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 170 deletions.
167 changes: 0 additions & 167 deletions packages/docs/src/examples/v-treeview/prop-item-disabled.vue

This file was deleted.

86 changes: 86 additions & 0 deletions packages/docs/src/examples/v-treeview/prop-item-props.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<template>
<v-treeview
:items="items"
item-props
selectable
></v-treeview>
</template>

<script setup>
import { ref } from 'vue'
const items = ref([
{
id: 1,
title: 'Applications :',
disabled: true,
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 :',
disabled: true,
children: [
{ id: 8, title: 'index : ts' },
{ id: 9, title: 'bootstrap : ts' },
],
},
],
},
{
id: 10,
title: 'material2 :',
children: [
{
id: 11,
title: 'src :',
children: [
{ id: 12, title: 'v-btn : ts' },
{ id: 13, title: 'v-card : ts' },
{ id: 14, title: 'v-window : ts' },
],
},
],
},
],
},
{
id: 15,
title: 'Downloads :',
children: [
{ id: 16, title: 'October : pdf', disabled: true },
{ id: 17, title: 'November : pdf', disabled: true },
{ id: 18, title: 'Tutorial : html', disabled: true },
],
},
{
id: 19,
title: 'Videos :',
children: [
{
id: 20,
title: 'Tutorials :',
children: [
{ id: 21, title: 'Basic layouts : mp4' },
{ id: 22, title: 'Advanced techniques : mp4' },
{ id: 23, title: 'All about app : dir' },
],
},
{ id: 24, title: 'Intro : mov' },
{ id: 25, title: 'Conference introduction : avi' },
],
},
])
</script>
6 changes: 3 additions & 3 deletions packages/docs/src/pages/en/components/treeview.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ Treeview nodes can have a hover effect.
<ExamplesExample file="v-treeview/prop-hoverable" /> -->

#### Item disabled
#### Item props

Setting **item-disabled** prop allows to control which node's property disables the node when set to `true`.
If **item-props** is set to `true` then the whole item will be spread. In the following example, the disabled prop defined in each item will disable the item accordingly.

<ExamplesExample file="v-treeview/prop-item-disabled" />
<ExamplesExample file="v-treeview/prop-item-props" />

#### Load children

Expand Down

0 comments on commit 5deda0a

Please sign in to comment.