feat: dom结构优化

master
xjs 2025-05-27 13:22:40 +08:00
parent 545731d6d5
commit 8311f20c82
1 changed files with 9 additions and 1 deletions

View File

@ -575,14 +575,22 @@
}); });
}; };
const handleResize = () => {
myChart?.resize();
};
onMounted(() => { onMounted(() => {
window.addEventListener("resize", () => myChart?.resize()); window.addEventListener("resize", handleResize);
}); });
// //
watch(() => props.chartDataArray, () => { watch(() => props.chartDataArray, () => {
initChart(); initChart();
}, { deep: true }); }, { deep: true });
onUnmounted(() => {
window.removeEventListener("resize", handleResize);
myChart?.dispose();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>