作者 若依
提交者 Gitee

!316 禁用DictTag中el-tag渐变动画

Merge pull request !316 from 马小法/master
1 -<template>  
2 - <div>  
3 - <template v-for="(item, index) in options">  
4 - <template v-if="values.includes(item.dictValue)">  
5 - <span  
6 - v-if="item.listClass == 'default' || item.listClass == ''"  
7 - :key="item.dictValue"  
8 - :index="index"  
9 - :class="item.cssClass"  
10 - >{{ item.dictLabel }}</span  
11 - >  
12 - <el-tag  
13 - v-else  
14 - :key="item.dictValue"  
15 - :index="index"  
16 - :type="item.listClass == 'primary' ? '' : item.listClass"  
17 - :class="item.cssClass"  
18 - >  
19 - {{ item.dictLabel }}  
20 - </el-tag>  
21 - </template>  
22 - </template>  
23 - </div>  
24 -</template>  
25 -  
26 -<script>  
27 -export default {  
28 - name: "DictTag",  
29 - props: {  
30 - options: {  
31 - type: Array,  
32 - default: null,  
33 - },  
34 - value: [Number, String, Array],  
35 - },  
36 - computed: {  
37 - values() {  
38 - if (this.value !== null && typeof this.value !== 'undefined') {  
39 - return Array.isArray(this.value) ? this.value : [String(this.value)];  
40 - } else {  
41 - return [];  
42 - }  
43 - },  
44 - },  
45 -};  
46 -</script>  
47 -<style scoped>  
48 -.el-tag + .el-tag {  
49 - margin-left: 10px;  
50 -}  
51 -</style>  
  1 +<template>
  2 + <div>
  3 + <template v-for="(item, index) in options">
  4 + <template v-if="values.includes(item.dictValue)">
  5 + <span
  6 + v-if="item.listClass == 'default' || item.listClass == ''"
  7 + :key="item.dictValue"
  8 + :index="index"
  9 + :class="item.cssClass"
  10 + >{{ item.dictLabel }}</span
  11 + >
  12 + <el-tag
  13 + v-else
  14 + :disable-transitions="true"
  15 + :key="item.dictValue"
  16 + :index="index"
  17 + :type="item.listClass == 'primary' ? '' : item.listClass"
  18 + :class="item.cssClass"
  19 + >
  20 + {{ item.dictLabel }}
  21 + </el-tag>
  22 + </template>
  23 + </template>
  24 + </div>
  25 +</template>
  26 +
  27 +<script>
  28 +export default {
  29 + name: "DictTag",
  30 + props: {
  31 + options: {
  32 + type: Array,
  33 + default: null,
  34 + },
  35 + value: [Number, String, Array],
  36 + },
  37 + computed: {
  38 + values() {
  39 + if (this.value !== null && typeof this.value !== 'undefined') {
  40 + return Array.isArray(this.value) ? this.value : [String(this.value)];
  41 + } else {
  42 + return [];
  43 + }
  44 + },
  45 + },
  46 +};
  47 +</script>
  48 +<style scoped>
  49 +.el-tag + .el-tag {
  50 + margin-left: 10px;
  51 +}
  52 +</style>