From cb8f393a177148fecbd9a425abb5469ff94e38b2 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Wed, 4 Jan 2023 16:09:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=84=E4=BB=B6bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ValueItem/index.vue | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/ValueItem/index.vue b/src/components/ValueItem/index.vue index af8a19d7..d48729ce 100644 --- a/src/components/ValueItem/index.vue +++ b/src/components/ValueItem/index.vue @@ -86,16 +86,10 @@ import GeoComponent from '@/components/GeoComponent/index.vue'; import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable'; import { LocalStore } from '@/utils/comm'; -type valueType = string | number | boolean | undefined; - -interface Prop { - itemData?: any; - modelValue?: valueType; -} - -interface EmitProps { - (e: 'update:modelValue', data: valueType): void; -} +type Emits = { + (e: 'update:modelValue', data: string | number | boolean): void; +}; +const emit = defineEmits(); const props = defineProps({ itemData: { @@ -107,7 +101,14 @@ const props = defineProps({ default: '', }, }); -const emit = defineEmits(); +// type Props = { +// itemData?: Object; +// modelValue?: string | number | boolean; +// }; +// const props = withDefaults(defineProps(), { +// itemData: () => ({ type: 'object' }), +// modelValue: '', +// }); const componentsType = computed(() => { switch (props.itemData.type) {