show icons in layout select

This commit is contained in:
Nitwel
2020-10-05 15:28:20 +02:00
parent 282746a68f
commit 0afab5af69
2 changed files with 13 additions and 1 deletions

View File

@@ -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,
};
});

View File

@@ -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" />