refactor: 优化字典组件命名

This commit is contained in:
Ray.Hao
2025-12-02 21:08:08 +08:00
parent b9a34017bd
commit c88fe50c65
7 changed files with 14 additions and 10 deletions

View File

@@ -6,6 +6,7 @@
<span>{{ label }}</span>
</template>
</template>
<script setup lang="ts">
import { useDictStore } from "@/store";
@@ -17,11 +18,13 @@ const props = defineProps({
default: "default", //
},
});
const label = ref("");
const tagType = ref<"success" | "warning" | "info" | "primary" | "danger" | undefined>(); //
const tagSize = ref<"default" | "large" | "small">(props.size as "default" | "large" | "small"); //
const dictStore = useDictStore();
/**
* 根据字典项的值获取对应的 label tagType
* @param dictCode 字典编码
@@ -40,6 +43,7 @@ const getLabelAndTagByValue = async (dictCode: string, value: any) => {
tagType: dictItem?.tagType,
};
};
/**
* 更新 label tagType
*/