Skip to content

Commit 147a6a5

Browse files
fix: OrgChart template demo fixes
1 parent 4bf5e3f commit 147a6a5

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

apps/showcase/doc/organizationchart/TemplateDoc.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p>The <i>type</i> property of an OrganizationChartNode is used to map a template to a node. If it is undefined, the default template is used.</p>
44
</DocSectionText>
55
<div class="card overflow-x-auto">
6-
<OrganizationChart :value="data" collapsible>
6+
<OrganizationChart v-model:selectionKeys="selection" :value="data" collapsible selectionMode="single">
77
<template #country="slotProps">
88
<div class="flex flex-col items-center">
99
<img :alt="slotProps.node.label" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="`w-2rem flag flag-${slotProps.node.data}`" />
@@ -70,24 +70,25 @@ export default {
7070
}
7171
]
7272
},
73+
selection: {},
7374
code: {
7475
basic: `
75-
<OrganizationChart :value="data" collapsible>
76+
<OrganizationChart v-model:selectionKeys="selection" :value="data" collapsible selectionMode="single">
7677
<template #country="slotProps">
7778
<div class="flex flex-col items-center">
7879
<img :alt="slotProps.node.label" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="\`w-2rem flag flag-\${slotProps.node.data}\`" />
7980
<div class="mt-4 font-medium text-lg">{{ slotProps.node.label }}</div>
8081
</div>
8182
</template>
8283
<template #default="slotProps">
83-
<span>{{slotProps.node.data.label}}</span>
84+
<span>{{slotProps.node.label}}</span>
8485
</template>
8586
</OrganizationChart>
8687
`,
8788
options: `
8889
<template>
8990
<div class="card overflow-x-auto">
90-
<OrganizationChart :value="data" collapsible>
91+
<OrganizationChart v-model:selectionKeys="selection" :value="data" collapsible selectionMode="single">
9192
<template #country="slotProps">
9293
<div class="flex flex-col items-center">
9394
<img :alt="slotProps.node.label" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="\`w-2rem flag flag-\${slotProps.node.data}\`" />
@@ -152,7 +153,8 @@ export default {
152153
]
153154
}
154155
]
155-
}
156+
},
157+
selection: {},
156158
};
157159
}
158160
};
@@ -161,7 +163,7 @@ export default {
161163
composition: `
162164
<template>
163165
<div class="card overflow-x-auto">
164-
<OrganizationChart :value="data" collapsible>
166+
<OrganizationChart v-model:selectionKeys="selection" :value="data" collapsible selectionMode="single">
165167
<template #country="slotProps">
166168
<div class="flex flex-col items-center">
167169
<img :alt="slotProps.node.label" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="\`w-2rem flag flag-\${slotProps.node.data}\`" />
@@ -178,6 +180,7 @@ export default {
178180
<script setup>
179181
import { ref } from "vue";
180182
183+
const selection = ref({});
181184
const data = ref({
182185
key: '0',
183186
type: 'country',

apps/showcase/pages/organizationchart/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ export default {
3434
label: 'Basic',
3535
component: BasicDoc
3636
},
37-
{
38-
id: 'template',
39-
label: 'Template',
40-
component: TemplateDoc
41-
},
4237
{
4338
id: 'selection',
4439
label: 'Selection',
4540
component: SelectionDoc
4641
},
42+
{
43+
id: 'template',
44+
label: 'Template',
45+
component: TemplateDoc
46+
},
4747
{
4848
id: 'colored',
4949
label: 'Colored',

0 commit comments

Comments
 (0)