Skip to content

Commit

Permalink
feat: add vchart params in all hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
xuefei1313 committed Dec 27, 2024
1 parent f0b50b9 commit ee3237d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/vchart/src/core/vchart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,14 @@ export class VChart implements IVChart {
// 桑基图默认记载滚动条组件
pluginList.push('scrollbar');
}
// 额外补充部分钩子
// hook增加图表实例参数
const performanceHook = { ...(restOptions.performanceHook || {}) };
(['beforeDoRender'] as (keyof IPerformanceHook)[]).forEach(hookKey => {
performanceHook[hookKey] &&
(Object.keys(performanceHook) as (keyof IPerformanceHook)[]).forEach(hookKey => {
// @ts-ignore
restOptions.performanceHook[hookKey] = (...args) => {
// @ts-ignore
(restOptions.performanceHook[hookKey] = (...args) => {
// @ts-ignore
performanceHook[hookKey](...args, this as any);
});
performanceHook[hookKey](...args, this as any);
};
});

this._compiler = new Compiler(
Expand Down

0 comments on commit ee3237d

Please sign in to comment.