做一个表格每个 tD, 有很多信息。
现在发现当我新增第一行,用时 3ms, 到第 40行,要 20ms 一行了
数据结构:
1行 【{td对象},{td对象},{td对象},{td对象}】
2行 【{td对象},{td对象},{td对象},{td对象}】
。。。
每个td对象有下面这些信息
interface TableCell {
is_active:boolean
rc: { r: number, c: number, maxr: number, maxc: number },
value: string | number | Date, // 值
type?: string, // 单元格描述,自定义选择列表,引用数据,关联引用,数据输入,数据导入,数据计算
format?: {
string: { is_active: boolean },
number: { is_active: boolean, round: number, thousand_sep: false, unit: string, pre: string }, // pre是前缀 ,货币标识图案等 Thousand_sep 千分符
percentage: { is_active: boolean, round: number, }, // 百分比
date: { is_active: boolean, format: string, },
custom: { is_active: boolean, format: '', }
},
还有。。一堆。。省略
由于是自定义表格,所有很多信息是没法固定的,这是造成信息多的原因。
现在就面临优化的问题,感觉这样不行。请教优化思路