|
| 1 | +<script setup lang='ts'> |
| 2 | +import PrimeInput from '@/components/demo/PrimeInput.vue' |
| 3 | +
|
| 4 | +const primeAttributes = 'placeholder, options' |
| 5 | +
|
| 6 | +const options = ref([ |
| 7 | + { |
| 8 | + key: '0', |
| 9 | + label: 'Documents', |
| 10 | + data: 'Documents Folder', |
| 11 | + icon: 'pi pi-fw pi-inbox', |
| 12 | + children: [ |
| 13 | + { |
| 14 | + key: '0-0', |
| 15 | + label: 'Work', |
| 16 | + data: 'Work Folder', |
| 17 | + icon: 'pi pi-fw pi-cog', |
| 18 | + children: [ |
| 19 | + { key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' }, |
| 20 | + { key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }, |
| 21 | + ], |
| 22 | + }, |
| 23 | + { |
| 24 | + key: '0-1', |
| 25 | + label: 'Home', |
| 26 | + data: 'Home Folder', |
| 27 | + icon: 'pi pi-fw pi-home', |
| 28 | + children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }], |
| 29 | + }, |
| 30 | + ], |
| 31 | + }, |
| 32 | + { |
| 33 | + key: '1', |
| 34 | + label: 'Events', |
| 35 | + data: 'Events Folder', |
| 36 | + icon: 'pi pi-fw pi-calendar', |
| 37 | + children: [ |
| 38 | + { key: '1-0', label: 'Meeting', icon: 'pi pi-fw pi-calendar-plus', data: 'Meeting' }, |
| 39 | + { key: '1-1', label: 'Product Launch', icon: 'pi pi-fw pi-calendar-plus', data: 'Product Launch' }, |
| 40 | + { key: '1-2', label: 'Report Review', icon: 'pi pi-fw pi-calendar-plus', data: 'Report Review' }, |
| 41 | + ], |
| 42 | + }, |
| 43 | +]) |
| 44 | +
|
| 45 | +const schema |
| 46 | + = [ |
| 47 | + { |
| 48 | + $formkit: 'primeTreeSelect', |
| 49 | + name: 'treeSelectValue', |
| 50 | + label: 'Tree Select', |
| 51 | + selectionMode: 'multiple', |
| 52 | + options, |
| 53 | + placeholder: 'Make your selection', |
| 54 | + }, |
| 55 | + ] |
| 56 | +
|
| 57 | +const data = { } |
| 58 | +</script> |
| 59 | + |
| 60 | +<template> |
| 61 | + <div> |
| 62 | + <PrimeInput |
| 63 | + header="TreeSelect" :schema="schema" :data="data" |
| 64 | + :prime-attributes="primeAttributes" |
| 65 | + /> |
| 66 | + </div> |
| 67 | +</template> |
0 commit comments