Skip to content

Commit ee3237d

Browse files
committed
feat: add vchart params in all hooks
1 parent f0b50b9 commit ee3237d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/vchart/src/core/vchart.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,14 @@ export class VChart implements IVChart {
414414
// 桑基图默认记载滚动条组件
415415
pluginList.push('scrollbar');
416416
}
417-
// 额外补充部分钩子
417+
// hook增加图表实例参数
418418
const performanceHook = { ...(restOptions.performanceHook || {}) };
419-
(['beforeDoRender'] as (keyof IPerformanceHook)[]).forEach(hookKey => {
420-
performanceHook[hookKey] &&
419+
(Object.keys(performanceHook) as (keyof IPerformanceHook)[]).forEach(hookKey => {
420+
// @ts-ignore
421+
restOptions.performanceHook[hookKey] = (...args) => {
421422
// @ts-ignore
422-
(restOptions.performanceHook[hookKey] = (...args) => {
423-
// @ts-ignore
424-
performanceHook[hookKey](...args, this as any);
425-
});
423+
performanceHook[hookKey](...args, this as any);
424+
};
426425
});
427426

428427
this._compiler = new Compiler(

0 commit comments

Comments
 (0)