This commit is contained in:
kailong321200875 2024-03-21 10:55:21 +08:00
parent 467840bc4d
commit f977fdb05d
2 changed files with 6 additions and 3 deletions

View File

@ -20,7 +20,7 @@ const props = defineProps({
type: Object as PropType<EChartsOption>,
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(() => {
setTimeout(() => {
initChart()
}, 0)
window.addEventListener('resize', resizeHandler)

View File

@ -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 () => {
</BaseButton>
<Dialog v-model="dialogVisible" :title="t('dialogDemo.dialog')">
<div v-for="v in 10000" :key="v">{{ v }}</div>
<Echart />
<template #footer>
<BaseButton @click="dialogVisible = false">{{ t('dialogDemo.close') }}</BaseButton>
</template>