update DictTag/index.vue
This commit is contained in:
parent
3cdcf5303f
commit
506f9446b2
@ -3,10 +3,10 @@
|
||||
<template v-for="(item, index) in options">
|
||||
<template v-if="values.includes(item.dictValue)">
|
||||
<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>
|
||||
<el-tag size="small" v-else :disable-transitions="true" :key="item.dictValue" :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></span
|
||||
>
|
||||
<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>
|
||||
</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
@ -23,19 +23,19 @@ const props = defineProps({
|
||||
// 当前的值
|
||||
value: [Number, String, Array],
|
||||
showValue: false,
|
||||
});
|
||||
})
|
||||
|
||||
const values = computed(() => {
|
||||
if (props.value !== null && typeof props.value !== "undefined") {
|
||||
return Array.isArray(props.value) ? props.value : [String(props.value)];
|
||||
if (props.value !== null && typeof props.value !== 'undefined') {
|
||||
return Array.isArray(props.value) ? props.value : [String(props.value)]
|
||||
} else {
|
||||
return [];
|
||||
return []
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user