mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
show icons in layout select
This commit is contained in:
@@ -52,6 +52,9 @@
|
||||
:disabled="item.disabled"
|
||||
@click="multiple ? null : $emit('input', item.value)"
|
||||
>
|
||||
<v-list-item-icon v-if="multiple === false && allowOther === false && itemIcon !== null && item.icon">
|
||||
<v-icon :name="item.icon" />
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<span v-if="multiple === false" class="item-text">{{ item.text }}</span>
|
||||
<v-checkbox
|
||||
@@ -142,6 +145,10 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: 'value',
|
||||
},
|
||||
itemIcon: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
value: {
|
||||
type: [Array, String, Number] as PropType<InputValue>,
|
||||
default: null,
|
||||
@@ -215,6 +222,7 @@ export default defineComponent({
|
||||
return {
|
||||
text: item[props.itemText],
|
||||
value: item[props.itemValue],
|
||||
icon: item[props.itemIcon],
|
||||
disabled: item.disabled,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
<div class="layout-options">
|
||||
<div class="field">
|
||||
<div class="type-label">{{ $t('layout') }}</div>
|
||||
<v-select :items="layouts" item-text="name" item-value="id" v-model="layout" />
|
||||
<v-select :items="layouts" item-text="name" item-value="id" item-icon="icon" v-model="layout">
|
||||
<template v-if="currentLayout.icon" #prepend>
|
||||
<v-icon :name="currentLayout.icon" />
|
||||
</template>
|
||||
</v-select>
|
||||
</div>
|
||||
|
||||
<portal-target name="layout-options" class="portal-contents" />
|
||||
|
||||
Reference in New Issue
Block a user