multipleLineRenderer.ts 549 B

12345678910111213141516171819202122232425
  1. import Handsontable from '@sc/handsontable';
  2. import { parse, style } from '@/utils/frontend/dom';
  3. import { TreeNode } from '@sc/tree';
  4. export default function (
  5. instance: Handsontable,
  6. row: number,
  7. col: number,
  8. prop: string | number,
  9. value: any
  10. ): HTMLElement {
  11. let newValue = '';
  12. if (value) newValue = value.replaceAll('\n', '');
  13. const template = `
  14. <div class="ht-indent-renderer">
  15. <span>${newValue}</span>
  16. </div>
  17. `;
  18. // indent-renderer
  19. const container = parse(template) as HTMLElement;
  20. return container;
  21. }