mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-28 03:25:02 +08:00
fix(#518): make sure charts fit the container after next browser UI render
This commit is contained in:
@ -13,6 +13,7 @@ import {
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
h,
|
||||
nextTick,
|
||||
PropType,
|
||||
watchEffect,
|
||||
Vue2
|
||||
@ -143,6 +144,11 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
instance.setOption(option || realOption.value, realUpdateOptions.value);
|
||||
|
||||
// Make sure the chart fits the container in next UI render (after current task)
|
||||
setTimeout(() => {
|
||||
instance.resize();
|
||||
});
|
||||
}
|
||||
|
||||
function setOption(option: Option, updateOptions?: UpdateOptions) {
|
||||
|
||||
Reference in New Issue
Block a user