<template>
  <text>
    <template v-for="(dict, index) in getDictDatas2(type, value)">
      <!-- 默认样式 -->
      <text v-if="dict.colorType === 'default' || dict.colorType === '' || dict.colorType === undefined" :key="dict.value" :index="index"
            :class="dict.cssClass" :style="color">{{ $l(dict, 'label') }}</text>
    </template>
  </text>
</template>

<script>
import {getDictDatas2} from "@/util/dict";

export default {
  name: "DictTag",
  methods: {getDictDatas2},
  props: {
    type: String,
    value: [Number, String, Boolean, Array],
    color: {
      type: String,
      default: ''
    }
  },
  data() {
  	return {
      // 不要用$lang来判断语言，因为他不是响应式的，有时候会异常
      // locale:this.$lang.locale
    };
  }
};
</script>
<style scoped>
.el-tag + .el-tag {
  margin-left: 10px;
}
</style>
