fix: 优化历史记录性能

This commit is contained in:
MTrun 2022-02-08 11:29:33 +08:00
parent 1b7bcd3e32
commit b258b0f651

View File

@ -39,12 +39,13 @@ export const useChartHistoryStoreStore = defineStore({
actionType: HistoryActionTypeEnum,
targetType: HistoryTargetTypeEnum = HistoryTargetTypeEnum.CHART
) {
this.pushBackStackItem({
// 优化性能转为freeze
this.pushBackStackItem(Object.freeze({
[HistoryStackItemEnum.ID]: new Date().getTime().toString(),
[HistoryStackItemEnum.HISTORY_DATA]: item,
[HistoryStackItemEnum.ACTION_TYPE]: actionType,
[HistoryStackItemEnum.TARGET_TYPE]: targetType
})
}))
},
// * 画布初始化
canvasInit(canvas: EditCanvasType) {