sen
2025-08-15 47b04430376f2498e8ddd9eb77ebea1be4ec8f21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<template>
  <div>
    <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.listClass"
        >{{ item.dictLabel }}</span>
        <el-tag
          v-else
          :disable-transitions="true"
          :key="item.dictValue + ''"
          :index="index"
          :type="item.listClass"
          :class="item.listClass"
        >{{ item.dictLabel }}</el-tag>
      </template>
    </template>
  </div>
</template>
 
<script setup lang="ts">
import {computed} from "vue";
interface PropsI {
  options:Array<any>,
  value:any
}
const props = defineProps<PropsI>()
 
const values = computed(() => {
  if (props.value !== null && typeof props.value !== 'undefined') {
    return Array.isArray(props.value) ? props.value : [String(props.value)];
  } else {
    return [];
  }
})
 
</script>
 
<style scoped>
.el-tag + .el-tag {
  margin-left: 10px;
}
</style>