mirror of
https://github.com/directus/directus.git
synced 2026-01-25 09:48:08 -05:00
Merge pull request #585 from directus/fix-381
Add unnamed custom collection grouping.
This commit is contained in:
@@ -25,7 +25,7 @@ export default defineComponent({
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: i18n.t('empty_item'),
|
||||
default: null,
|
||||
},
|
||||
toggle: {
|
||||
type: Function,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:toggle="toggle"
|
||||
@delete="$emit('delete')"
|
||||
:disabled="disabled"
|
||||
:placeholder="headerPlaceholder"
|
||||
/>
|
||||
<transition-expand>
|
||||
<div v-if="active">
|
||||
@@ -46,6 +47,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
headerPlaceholder: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
@input="updateValues(index, $event)"
|
||||
@delete="removeItem(row)"
|
||||
:disabled="disabled"
|
||||
:headerPlaceholder="headerPlaceholder"
|
||||
/>
|
||||
</draggable>
|
||||
<button @click="addNew" class="add-new" v-if="showAddNew">
|
||||
@@ -54,6 +55,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
headerPlaceholder: {
|
||||
type: String,
|
||||
default: i18n.t('empty_item'),
|
||||
}
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const selection = ref<number[]>([]);
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
<template>
|
||||
<v-list large>
|
||||
<template v-if="customNavItems && customNavItems.length > 0">
|
||||
<v-detail
|
||||
:active="group.accordion === 'always_open' || undefined"
|
||||
:disabled="group.accordion === 'always_open'"
|
||||
:start-open="group.accordion === 'start_open'"
|
||||
:label="group.name"
|
||||
:key="group.name"
|
||||
v-for="group in customNavItems"
|
||||
>
|
||||
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
|
||||
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
|
||||
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-detail>
|
||||
<template v-for="(group, index) in customNavItems">
|
||||
<template v-if="(group.name === undefined || group.name === null) && group.accordion === 'always_open' && index === 0">
|
||||
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
|
||||
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
|
||||
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
|
||||
</v-list-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-detail
|
||||
:active="group.accordion === 'always_open' || undefined"
|
||||
:disabled="group.accordion === 'always_open'"
|
||||
:start-open="group.accordion === 'start_open'"
|
||||
:label="group.name || null"
|
||||
:key="group.name"
|
||||
>
|
||||
<v-list-item :exact="exact" v-for="navItem in group.items" :key="navItem.to" :to="navItem.to">
|
||||
<v-list-item-icon><v-icon :name="navItem.icon" /></v-list-item-icon>
|
||||
<v-list-item-content>{{ navItem.name }}</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-detail>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<v-list-item v-else :exact="exact" v-for="navItem in navItems" :key="navItem.to" :to="navItem.to">
|
||||
|
||||
Reference in New Issue
Block a user