update DictTag/index.vue
This commit is contained in:
parent
3cdcf5303f
commit
506f9446b2
@ -3,9 +3,9 @@
|
|||||||
<template v-for="(item, index) in options">
|
<template v-for="(item, index) in options">
|
||||||
<template v-if="values.includes(item.dictValue)">
|
<template v-if="values.includes(item.dictValue)">
|
||||||
<span v-if="item.listClass == 'default' || item.listClass == ''" :key="item.dictValue" :index="index" :class="item.cssClass">
|
<span v-if="item.listClass == 'default' || item.listClass == ''" :key="item.dictValue" :index="index" :class="item.cssClass">
|
||||||
{{ item.dictLabel }} <i v-if="showValue">#{{item.dictValue}}</i></span>
|
{{ item.dictLabel }} <i v-if="showValue">#{{ item.dictValue }}</i></span
|
||||||
<el-tag size="small" v-else :disable-transitions="true" :key="item.dictValue" :index="index"
|
>
|
||||||
:type="item.listClass == 'primary' ? '' : item.listClass" :class="item.cssClass">
|
<el-tag size="small" v-else :disable-transitions="true" :index="index" :type="item.listClass == 'primary' ? '' : item.listClass" :class="item.cssClass">
|
||||||
{{ item.dictLabel }}<i v-if="showValue">#{{ item.dictValue }}</i>
|
{{ item.dictLabel }}<i v-if="showValue">#{{ item.dictValue }}</i>
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
@ -23,15 +23,15 @@ const props = defineProps({
|
|||||||
// 当前的值
|
// 当前的值
|
||||||
value: [Number, String, Array],
|
value: [Number, String, Array],
|
||||||
showValue: false,
|
showValue: false,
|
||||||
});
|
})
|
||||||
|
|
||||||
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)]
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return []
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user