调整字典数据显示组件
This commit is contained in:
parent
97683f468b
commit
75badfa160
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<template v-for="(item, index) in options">
|
<template v-for="(item, index) in getOptions" :key="index">
|
||||||
<span v-if="values.includes(item.value)" :key="index">{{ item.name }}</span>
|
<span>{{ index != 0 ? '、' : '' }}{{ item.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -13,9 +13,13 @@ const props = defineProps<{
|
||||||
|
|
||||||
const values = computed(() => {
|
const values = computed(() => {
|
||||||
if (props.value !== null && typeof props.value !== 'undefined') {
|
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 {
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getOptions = computed(() => {
|
||||||
|
return props.options.filter((item) => values.value.includes(item.value))
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<ImageContain :width="szie" :height="szie" :src="config.webLogo" />
|
<image-contain :width="szie" :height="szie" :src="config.webLogo" />
|
||||||
<transition name="title-width">
|
<transition name="title-width">
|
||||||
<div
|
<div
|
||||||
v-show="showTitle"
|
v-show="showTitle"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue