import Handsontable from '@sc/handsontable';
import createRenderer from '@/components/handsontable/renderer/createRenderer';
import registerRendererList from './index';
import costSwitcherRenderer from './renderers/costSwitcherRenderer';

const { renderers } = Handsontable;
registerRendererList.map(item => {
  const rendererName = item[0];
  const renderer = item[1];
  renderers.registerRenderer(rendererName, createRenderer(renderer));
  return item;
});

// 原生的注册方法
renderers.registerRenderer('wc.cost.switcherRenderer', costSwitcherRenderer);
