diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 6589a556e..eac33defb 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -412,6 +412,11 @@ export const resizeTabs = () => { setTimeout(() => { // .layout .fn__flex-shrink {transition: width .3s ease;} 时需要再次计算 padding setPadding(item.editor.protyle); + if (echarts) { + (item.editor.protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => { + echarts.getInstanceById(chartItem.firstElementChild.nextElementSibling.getAttribute("_echarts_instance_")).resize(); + })) + } }, 200); } }); diff --git a/app/src/types/protyle.d.ts b/app/src/types/protyle.d.ts index 2737f678e..7803ea06c 100644 --- a/app/src/types/protyle.d.ts +++ b/app/src/types/protyle.d.ts @@ -1,6 +1,7 @@ declare const echarts: { init(element: HTMLElement, theme?: string, options?: { width: number }): IEChart; dispose(element: Element): void; + getInstanceById(id: string): { resize: () => void }; }; declare const hljs: {