style: dict
This commit is contained in:
parent
83cfe991f5
commit
4259f96c2b
@ -1,28 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DictData } from '#/api/system/dict/dict-data-model';
|
import type { DictData } from '#/api/system/dict/dict-data-model';
|
||||||
|
|
||||||
import { computed, watch } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { Tag } from 'ant-design-vue';
|
import { Tag } from 'ant-design-vue';
|
||||||
|
|
||||||
import { tagTypes } from './data';
|
import { tagTypes } from './data';
|
||||||
|
|
||||||
const props = withDefaults(
|
interface Props {
|
||||||
defineProps<{
|
|
||||||
dicts: DictData[]; // dict数组
|
dicts: DictData[]; // dict数组
|
||||||
value: number | string; // value
|
value: number | string; // value
|
||||||
}>(),
|
}
|
||||||
{
|
|
||||||
dicts: undefined,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
() => props.dicts,
|
dicts: undefined,
|
||||||
(value) => {
|
});
|
||||||
console.log('dicts change', value);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const color = computed<string>(() => {
|
const color = computed<string>(() => {
|
||||||
// eslint-disable-next-line eqeqeq
|
// eslint-disable-next-line eqeqeq
|
||||||
|
@ -1,28 +1,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DictData } from '#/api/system/dict/dict-data-model';
|
import type { DictData } from '#/api/system/dict/dict-data-model';
|
||||||
|
|
||||||
import { computed, watch } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
import { Tag } from 'ant-design-vue';
|
import { Tag } from 'ant-design-vue';
|
||||||
|
|
||||||
import { tagTypes } from './data';
|
import { tagTypes } from './data';
|
||||||
|
|
||||||
const props = withDefaults(
|
interface Props {
|
||||||
defineProps<{
|
|
||||||
dicts: DictData[]; // dict数组
|
dicts: DictData[]; // dict数组
|
||||||
value: number | string; // value
|
value: number | string; // value
|
||||||
}>(),
|
}
|
||||||
{
|
|
||||||
dicts: undefined,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
() => props.dicts,
|
dicts: undefined,
|
||||||
(value) => {
|
});
|
||||||
console.log('dicts change', value);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const color = computed<string>(() => {
|
const color = computed<string>(() => {
|
||||||
// eslint-disable-next-line eqeqeq
|
// eslint-disable-next-line eqeqeq
|
||||||
|
Loading…
Reference in New Issue
Block a user