Просмотр исходного кода

!1464 新增字典渲染组件
Merge pull request !1464 from 喵你个汪/jasondom-next

zuohuaijun 1 год назад
Родитель
Сommit
37e0cc68a0
1 измененных файлов с 17 добавлено и 0 удалено
  1. 17 0
      Web/src/components/table/dictLabel.vue

+ 17 - 0
Web/src/components/table/dictLabel.vue

@@ -0,0 +1,17 @@
+<template>
+	<ElTag :type="dict?.tagType ?? ''">{{ dict?.name ?? defaultValue ?? '-' }}</ElTag>
+</template>
+
+<script lang="ts" setup>
+import { useUserInfo } from '/@/stores/userInfo';
+import { reactive } from 'vue';
+import { ElTag } from 'element-plus';
+
+const props = defineProps<{
+	code: string;
+	value: any;
+	defaultValue: string
+}>();
+
+const dict = reactive(useUserInfo().getDictLabelByVal(props.code, props.value + ""));
+</script>