|
@@ -1,49 +1,33 @@
|
|
<template>
|
|
<template>
|
|
<v-list class="side-box" color="primary">
|
|
<v-list class="side-box" color="primary">
|
|
- <template v-for="(val, index) in item.items" :key="item?.itemValue? val[item.itemValue] : index">
|
|
|
|
|
|
+ <template v-for="(val, index) in list" :key="option?.itemValue? val[option.itemValue] : index">
|
|
<template v-if="!val.children?.length">
|
|
<template v-if="!val.children?.length">
|
|
<v-list-item
|
|
<v-list-item
|
|
active-class="active"
|
|
active-class="active"
|
|
color="primary"
|
|
color="primary"
|
|
- :title="val[item.itemText || 'label']"
|
|
|
|
|
|
+ :title="val[option.itemText || 'label']"
|
|
>
|
|
>
|
|
</v-list-item>
|
|
</v-list-item>
|
|
</template>
|
|
</template>
|
|
<v-list-group
|
|
<v-list-group
|
|
v-else
|
|
v-else
|
|
color="primary"
|
|
color="primary"
|
|
- :prepend-icon="val.icon"
|
|
|
|
>
|
|
>
|
|
<template v-slot:activator="{ props }">
|
|
<template v-slot:activator="{ props }">
|
|
- <v-list-item v-bind="props" :title="val[item.itemText || 'label']"></v-list-item>
|
|
|
|
|
|
+ <v-list-item v-bind="props" :title="val[option.itemText || 'label']"></v-list-item>
|
|
</template>
|
|
</template>
|
|
- <template v-for="(k, i) in val.children" :key="item?.itemValue? k[item.itemValue] : i">
|
|
|
|
- <v-list-item
|
|
|
|
- v-if="!k.children?.length"
|
|
|
|
- active-class="active"
|
|
|
|
- color="primary"
|
|
|
|
- :title="k[item.itemText || 'label']"
|
|
|
|
- ></v-list-item>
|
|
|
|
- <listGroup v-else :item="k"></listGroup>
|
|
|
|
- </template>
|
|
|
|
- <!-- <v-list-item
|
|
|
|
- v-for="(k, i) in val.children"
|
|
|
|
- :key="`k_${i}`"
|
|
|
|
- color="primary"
|
|
|
|
- style="padding-left: 40px;"
|
|
|
|
- :title="k[item.itemText || 'label']"
|
|
|
|
- :value="k[item.itemValue || 'value']"
|
|
|
|
- ></v-list-item> -->
|
|
|
|
|
|
+ <listGroup :list="val.children" :option="option"></listGroup>
|
|
</v-list-group>
|
|
</v-list-group>
|
|
</template>
|
|
</template>
|
|
</v-list>
|
|
</v-list>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import listGroup from './listGroup'
|
|
|
|
|
|
+// import listGroup from './listGroup'
|
|
defineOptions({ name:'nestedListGroup-listGroup'})
|
|
defineOptions({ name:'nestedListGroup-listGroup'})
|
|
-const propsData = defineProps({item: Object})
|
|
|
|
-const item = propsData.item
|
|
|
|
|
|
+const propsData = defineProps({list: Array, option: Object})
|
|
|
|
+const list = propsData.list
|
|
|
|
+const option = propsData.option
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
</style>
|
|
</style>
|