Skip to content

Commit e3d7ccc

Browse files
committed
fix: correct the type for undo-redo plugin
1 parent eefa808 commit e3d7ccc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

front-end/h5/src/components/core/support/shape.js

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export default {
9494
this.handlePointMoveProp(pos)
9595
}
9696
let up = () => {
97+
this.handlePointMouseUpProp()
9798
document.removeEventListener('mousemove', move)
9899
document.removeEventListener('mouseup', up)
99100
}
@@ -125,6 +126,7 @@ export default {
125126
}
126127

127128
let up = moveEvent => {
129+
this.handleElementMouseUpProp()
128130
document.removeEventListener('mousemove', move, true)
129131
document.removeEventListener('mouseup', up, true)
130132
}

front-end/h5/src/store/plugins/undo-redo/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22
import { cloneDeep } from 'lodash'
33
import undoRedoHistory from './History'
4-
const unRecordHistoryMutationTypes = ['element/setElementCommonStyle']
4+
/**
5+
* #!zh: setElementCommonStyle 因为是在 mousemove 时候触发的,执行过于频繁,没有必要计入history,因此需要过滤。
6+
* 主要记录:拖动完成时候(mouseup)时候的位置、删除元素之前的状态等
7+
*/
8+
const unRecordHistoryMutationTypes = ['editor/setElementCommonStyle']
59

610
const undoRedoPlugin = (store) => {
711
// initialize and save the starting stage

0 commit comments

Comments
 (0)