1704
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
<template>
|
||||
<template v-for="(item, index) in dataList">
|
||||
<template v-if="values.includes(item.dictValue)">
|
||||
<el-tag
|
||||
v-if="dictValues.includes(item.listClass)"
|
||||
size="small"
|
||||
:disable-transitions="true"
|
||||
:index="index"
|
||||
:type="item.listClass"
|
||||
:class="item.cssClass">
|
||||
<el-tag v-if="dictValues.includes(item.listClass)" size="small" :disable-transitions="true" :index="index"
|
||||
:type="item.listClass" :class="item.cssClass">
|
||||
<template v-if="item.langKey">
|
||||
{{ $t(item.langKey) }}
|
||||
</template>
|
||||
@@ -67,6 +62,9 @@ const dataList = computed(() => {
|
||||
})
|
||||
const values = computed(() => {
|
||||
if (props.value !== null && typeof props.value !== 'undefined') {
|
||||
if (typeof props.value === 'number') {
|
||||
return [props.value]
|
||||
}
|
||||
if (props.split != null && props.split != '') {
|
||||
return props.value.split(props.split) ?? []
|
||||
} else {
|
||||
@@ -80,7 +78,7 @@ const dictValues = ref(['primary', 'danger', 'warning', 'info', 'success'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tag + .el-tag {
|
||||
.el-tag+.el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user