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(() => {
initChart()
setTimeout(() => {
initChart()
}, 0)
window.addEventListener('resize', resizeHandler)