2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
2023-10-07 09:30:48 +00:00
|
|
|
<p>Each node can have a distinct template by matching the <i>type</i> property to the slot name.</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</DocSectionText>
|
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Tree :value="nodes" class="w-full md:w-30rem">
|
|
|
|
<template #default="slotProps">
|
|
|
|
<b>{{ slotProps.node.label }}</b>
|
|
|
|
</template>
|
|
|
|
<template #url="slotProps">
|
2023-10-07 09:30:48 +00:00
|
|
|
<a :href="slotProps.node.data" target="_blank" rel="noopener noreferrer" class="text-700 hover:text-primary">{{ slotProps.node.label }}</a>
|
2023-02-28 08:29:30 +00:00
|
|
|
</template>
|
|
|
|
</Tree>
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
nodes: [
|
|
|
|
{
|
|
|
|
key: '0',
|
|
|
|
label: 'Introduction',
|
|
|
|
children: [
|
|
|
|
{ key: '0-0', label: 'What is Vue.js?', data: 'https://vuejs.org/guide/introduction.html#what-is-vue', type: 'url' },
|
|
|
|
{ key: '0-1', label: 'Quick Start', data: 'https://vuejs.org/guide/quick-start.html#quick-start', type: 'url' },
|
|
|
|
{ key: '0-2', label: 'Creating a Vue Application', data: 'https://vuejs.org/guide/essentials/application.html#creating-a-vue-application', type: 'url' },
|
2023-10-07 09:30:48 +00:00
|
|
|
{ key: '0-3', label: 'Conditional Rendering', data: 'https://vuejs.org/guide/essentials/conditional.html#conditional-rendering', type: 'url' }
|
2023-02-28 08:29:30 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: '1',
|
|
|
|
label: 'Components In-Depth',
|
|
|
|
children: [
|
|
|
|
{ key: '1-0', label: 'Component Registration', data: 'https://vuejs.org/guide/components/registration.html#component-registration', type: 'url' },
|
|
|
|
{ key: '1-1', label: 'Props', data: 'https://vuejs.org/guide/components/props.html#props', type: 'url' },
|
|
|
|
{ key: '1-2', label: 'Components Events', data: 'https://vuejs.org/guide/components/events.html#component-events', type: 'url' },
|
|
|
|
{ key: '1-3', label: 'Slots', data: 'https://vuejs.org/guide/components/slots.html#slots', type: 'url' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<Tree :value="nodes" class="w-full md:w-30rem">
|
2023-02-28 08:29:30 +00:00
|
|
|
<template #default="slotProps">
|
|
|
|
<b>{{ slotProps.node.label }}</b>
|
|
|
|
</template>
|
|
|
|
<template #url="slotProps">
|
|
|
|
<a :href="slotProps.node.data">{{ slotProps.node.label }}</a>
|
|
|
|
</template>
|
|
|
|
</Tree>`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Tree :value="nodes" class="w-full md:w-30rem">
|
|
|
|
<template #default="slotProps">
|
|
|
|
<b>{{ slotProps.node.label }}</b>
|
|
|
|
</template>
|
|
|
|
<template #url="slotProps">
|
2023-10-07 09:30:48 +00:00
|
|
|
<a :href="slotProps.node.data" target="_blank" rel="noopener noreferrer" class="text-700 hover:text-primary">{{ slotProps.node.label }}</a>
|
2023-02-28 08:29:30 +00:00
|
|
|
</template>
|
|
|
|
</Tree>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
nodes: [
|
|
|
|
{
|
|
|
|
key: '0',
|
|
|
|
label: 'Introduction',
|
|
|
|
children: [
|
|
|
|
{ key: '0-0', label: 'What is Vue.js?', data: 'https://vuejs.org/guide/introduction.html#what-is-vue', type: 'url' },
|
|
|
|
{ key: '0-1', label: 'Quick Start', data: 'https://vuejs.org/guide/quick-start.html#quick-start', type: 'url' },
|
|
|
|
{ key: '0-2', label: 'Creating a Vue Application', data: 'https://vuejs.org/guide/essentials/application.html#creating-a-vue-application', type: 'url' },
|
2023-10-07 09:30:48 +00:00
|
|
|
{ key: '0-3', label: 'Conditional Rendering', data: 'https://vuejs.org/guide/essentials/conditional.html#conditional-rendering', type: 'url' }
|
2023-02-28 08:29:30 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: '1',
|
|
|
|
label: 'Components In-Depth',
|
|
|
|
children: [
|
|
|
|
{ key: '1-0', label: 'Component Registration', data: 'https://vuejs.org/guide/components/registration.html#component-registration', type: 'url' },
|
|
|
|
{ key: '1-1', label: 'Props', data: 'https://vuejs.org/guide/components/props.html#props', type: 'url' },
|
|
|
|
{ key: '1-2', label: 'Components Events', data: 'https://vuejs.org/guide/components/events.html#component-events', type: 'url' },
|
|
|
|
{ key: '1-3', label: 'Slots', data: 'https://vuejs.org/guide/components/slots.html#slots', type: 'url' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
<\/script>`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<Tree :value="nodes" class="w-full md:w-30rem">
|
|
|
|
<template #default="slotProps">
|
|
|
|
<b>{{ slotProps.node.label }}</b>
|
|
|
|
</template>
|
|
|
|
<template #url="slotProps">
|
2023-10-07 09:30:48 +00:00
|
|
|
<a :href="slotProps.node.data" target="_blank" rel="noopener noreferrer" class="text-700 hover:text-primary">{{ slotProps.node.label }}</a>
|
2023-02-28 08:29:30 +00:00
|
|
|
</template>
|
|
|
|
</Tree>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
const nodes = ref([
|
|
|
|
{
|
|
|
|
key: '0',
|
|
|
|
label: 'Introduction',
|
|
|
|
children: [
|
|
|
|
{ key: '0-0', label: 'What is Vue.js?', data: 'https://vuejs.org/guide/introduction.html#what-is-vue', type: 'url' },
|
|
|
|
{ key: '0-1', label: 'Quick Start', data: 'https://vuejs.org/guide/quick-start.html#quick-start', type: 'url' },
|
|
|
|
{ key: '0-2', label: 'Creating a Vue Application', data: 'https://vuejs.org/guide/essentials/application.html#creating-a-vue-application', type: 'url' },
|
2023-10-07 09:30:48 +00:00
|
|
|
{ key: '0-3', label: 'Conditional Rendering', data: 'https://vuejs.org/guide/essentials/conditional.html#conditional-rendering', type: 'url' }
|
2023-02-28 08:29:30 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: '1',
|
|
|
|
label: 'Components In-Depth',
|
|
|
|
children: [
|
|
|
|
{ key: '1-0', label: 'Component Registration', data: 'https://vuejs.org/guide/components/registration.html#component-registration', type: 'url' },
|
|
|
|
{ key: '1-1', label: 'Props', data: 'https://vuejs.org/guide/components/props.html#props', type: 'url' },
|
|
|
|
{ key: '1-2', label: 'Components Events', data: 'https://vuejs.org/guide/components/events.html#component-events', type: 'url' },
|
|
|
|
{ key: '1-3', label: 'Slots', data: 'https://vuejs.org/guide/components/slots.html#slots', type: 'url' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]);
|
2023-03-13 10:57:47 +00:00
|
|
|
<\/script>`,
|
|
|
|
data: `
|
|
|
|
{
|
|
|
|
key: '0',
|
|
|
|
label: 'Documents',
|
|
|
|
data: 'Documents Folder',
|
|
|
|
icon: 'pi pi-fw pi-inbox',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
key: '0-0',
|
|
|
|
label: 'Work',
|
|
|
|
data: 'Work Folder',
|
|
|
|
icon: 'pi pi-fw pi-cog',
|
|
|
|
children: [
|
|
|
|
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
|
|
|
|
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: '0-1',
|
|
|
|
label: 'Home',
|
|
|
|
data: 'Home Folder',
|
|
|
|
icon: 'pi pi-fw pi-home',
|
|
|
|
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
...`
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|