From f977fdb05d018ee07baeb6db454b9a77acb89f07 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Thu, 21 Mar 2024 10:55:21 +0800 Subject: [PATCH] fix: #438 --- src/components/Echart/src/Echart.vue | 6 ++++-- src/views/Components/Dialog.vue | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Echart/src/Echart.vue b/src/components/Echart/src/Echart.vue index 84f23da..58cae29 100644 --- a/src/components/Echart/src/Echart.vue +++ b/src/components/Echart/src/Echart.vue @@ -20,7 +20,7 @@ const props = defineProps({ type: Object as PropType, required: true }, - width: propTypes.oneOfType([Number, String]).def(''), + width: propTypes.oneOfType([Number, String]).def('100%'), height: propTypes.oneOfType([Number, String]).def('500px') }) @@ -86,7 +86,9 @@ const contentResizeHandler = async (e: TransitionEvent) => { } onMounted(() => { - initChart() + setTimeout(() => { + initChart() + }, 0) window.addEventListener('resize', resizeHandler) diff --git a/src/views/Components/Dialog.vue b/src/views/Components/Dialog.vue index a718489..cd7e16a 100644 --- a/src/views/Components/Dialog.vue +++ b/src/views/Components/Dialog.vue @@ -7,6 +7,7 @@ import { Form, FormSchema } from '@/components/Form' import { useValidator } from '@/hooks/web/useValidator' import { getDictOneApi } from '@/api/common' import { useForm } from '@/hooks/web/useForm' +import Echart from './Echart.vue' const { required } = useValidator() @@ -113,7 +114,7 @@ const formSubmit = async () => { -
{{ v }}
+