chore: 流程定义(未完成)

This commit is contained in:
dap
2024-12-12 09:08:07 +08:00
parent 97b91aaf7c
commit 8f9215ffad
5 changed files with 138 additions and 175 deletions

View File

@@ -1 +1,2 @@
export { default as OptionsTag } from './src/options-tag.vue';
export { default as TableSwitch } from './src/table-switch.vue';

View File

@@ -0,0 +1,21 @@
<script setup lang="tsx">
import { computed } from 'vue';
import { Tag } from 'ant-design-vue';
defineOptions({ name: 'OptionsTag' });
const props = defineProps<{
options: { color?: string; label: string; value: number | string }[];
value: number | string;
}>();
const found = computed(() =>
props.options.find((item) => item.value === props.value),
);
</script>
<template>
<Tag v-if="found" :color="found.color">{{ found.label }}</Tag>
<span v-else>未知</span>
</template>