fix dot display

This commit is contained in:
Ben Haynes
2020-09-08 13:11:50 -04:00
parent 8811d2a3b4
commit 0f2b08fc47
2 changed files with 6 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div>
<value-null v-if="value === null" />
<div class="dot" :style="styles">{{ displayValue }}</div>
<div class="dot" :style="styles" v-tooltip="displayValue"></div>
</div>
</template>
@@ -25,13 +25,9 @@ export default defineComponent({
type: Array as PropType<Choice[]>,
default: () => [],
},
defaultBackground: {
defaultColor: {
type: String,
default: '#eceff1',
},
defaultForeground: {
type: String,
default: '#263238',
default: '#B0BEC5',
},
},
setup(props) {
@@ -42,13 +38,12 @@ export default defineComponent({
});
const displayValue = computed(() => {
if (!currentChoice.value) return formatTitle(props.value);
return currentChoice.value.text;
return formatTitle(props.value);
});
const styles = computed(() => {
return {
backgroundColor: currentChoice.value?.color || props.defaultForeground,
backgroundColor: currentChoice.value?.color || props.defaultColor,
};
});

View File

@@ -17,7 +17,7 @@ export default defineDisplay(({ i18n }) => ({
width: 'half',
},
schema: {
default_value: '#eceff1',
default_value: '#B0BEC5',
},
},
{