调整字典数据显示组件

This commit is contained in:
Jason 2022-08-16 18:52:50 +08:00
parent 97683f468b
commit 75badfa160
2 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<template>
<div>
<template v-for="(item, index) in options">
<span v-if="values.includes(item.value)" :key="index">{{ item.name }}</span>
<template v-for="(item, index) in getOptions" :key="index">
<span>{{ index != 0 ? '、' : '' }}{{ item.name }}</span>
</template>
</div>
</template>
@ -13,9 +13,13 @@ const props = defineProps<{
const values = computed(() => {
if (props.value !== null && typeof props.value !== 'undefined') {
return Array.isArray(props.value) ? props.value : [String(props.value)]
return Array.isArray(props.value) ? props.value : String(props.value).split(',')
} else {
return []
}
})
const getOptions = computed(() => {
return props.options.filter((item) => values.value.includes(item.value))
})
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="logo">
<ImageContain :width="szie" :height="szie" :src="config.webLogo" />
<image-contain :width="szie" :height="szie" :src="config.webLogo" />
<transition name="title-width">
<div
v-show="showTitle"