123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <template>
- <div class="m-4">
- <p>Child options expand when clicked (default)</p>
- <el-cascader v-model="value" :options="options" @change="handleChange" />
- </div>
- <div class="m-4">
- <p>Child options expand when hovered</p>
- <el-cascader
- v-model="value"
- :options="options"
- :props="props"
- @change="handleChange"
- />
- </div>
- </template>
- <script lang="ts" setup>
- import { ref } from 'vue'
- const value = ref([])
- const props = {
- expandTrigger: 'hover' as const,
- }
- const handleChange = (value) => {
- console.log(value)
- }
- const options = [
- {
- value: 'guide',
- label: 'Guide',
- children: [
- {
- value: 'disciplines',
- label: 'Disciplines',
- children: [
- {
- value: 'consistency',
- label: 'Consistency',
- },
- {
- value: 'feedback',
- label: 'Feedback',
- },
- {
- value: 'efficiency',
- label: 'Efficiency',
- },
- {
- value: 'controllability',
- label: 'Controllability',
- },
- ],
- },
- {
- value: 'navigation',
- label: 'Navigation',
- children: [
- {
- value: 'side nav',
- label: 'Side Navigation',
- },
- {
- value: 'top nav',
- label: 'Top Navigation',
- },
- ],
- },
- ],
- },
- {
- value: 'component',
- label: 'Component',
- children: [
- {
- value: 'basic',
- label: 'Basic',
- children: [
- {
- value: 'layout',
- label: 'Layout',
- },
- {
- value: 'color',
- label: 'Color',
- },
- {
- value: 'typography',
- label: 'Typography',
- },
- {
- value: 'icon',
- label: 'Icon',
- },
- {
- value: 'button',
- label: 'Button',
- },
- ],
- },
- {
- value: 'form',
- label: 'Form',
- children: [
- {
- value: 'radio',
- label: 'Radio',
- },
- {
- value: 'checkbox',
- label: 'Checkbox',
- },
- {
- value: 'input',
- label: 'Input',
- },
- {
- value: 'input-number',
- label: 'InputNumber',
- },
- {
- value: 'select',
- label: 'Select',
- },
- {
- value: 'cascader',
- label: 'Cascader',
- },
- {
- value: 'switch',
- label: 'Switch',
- },
- {
- value: 'slider',
- label: 'Slider',
- },
- {
- value: 'time-picker',
- label: 'TimePicker',
- },
- {
- value: 'date-picker',
- label: 'DatePicker',
- },
- {
- value: 'datetime-picker',
- label: 'DateTimePicker',
- },
- {
- value: 'upload',
- label: 'Upload',
- },
- {
- value: 'rate',
- label: 'Rate',
- },
- {
- value: 'form',
- label: 'Form',
- },
- ],
- },
- {
- value: 'data',
- label: 'Data',
- children: [
- {
- value: 'table',
- label: 'Table',
- },
- {
- value: 'tag',
- label: 'Tag',
- },
- {
- value: 'progress',
- label: 'Progress',
- },
- {
- value: 'tree',
- label: 'Tree',
- },
- {
- value: 'pagination',
- label: 'Pagination',
- },
- {
- value: 'badge',
- label: 'Badge',
- },
- ],
- },
- {
- value: 'notice',
- label: 'Notice',
- children: [
- {
- value: 'alert',
- label: 'Alert',
- },
- {
- value: 'loading',
- label: 'Loading',
- },
- {
- value: 'message',
- label: 'Message',
- },
- {
- value: 'message-box',
- label: 'MessageBox',
- },
- {
- value: 'notification',
- label: 'Notification',
- },
- ],
- },
- {
- value: 'navigation',
- label: 'Navigation',
- children: [
- {
- value: 'menu',
- label: 'Menu',
- },
- {
- value: 'tabs',
- label: 'Tabs',
- },
- {
- value: 'breadcrumb',
- label: 'Breadcrumb',
- },
- {
- value: 'dropdown',
- label: 'Dropdown',
- },
- {
- value: 'steps',
- label: 'Steps',
- },
- ],
- },
- {
- value: 'others',
- label: 'Others',
- children: [
- {
- value: 'dialog',
- label: 'Dialog',
- },
- {
- value: 'tooltip',
- label: 'Tooltip',
- },
- {
- value: 'popover',
- label: 'Popover',
- },
- {
- value: 'card',
- label: 'Card',
- },
- {
- value: 'carousel',
- label: 'Carousel',
- },
- {
- value: 'collapse',
- label: 'Collapse',
- },
- ],
- },
- ],
- },
- {
- value: 'resource',
- label: 'Resource',
- children: [
- {
- value: 'axure',
- label: 'Axure Components',
- },
- {
- value: 'sketch',
- label: 'Sketch Templates',
- },
- {
- value: 'docs',
- label: 'Design Documentation',
- },
- ],
- },
- ]
- </script>
|