Commit 0f4a2cb 1 parent 51c0ab1 commit 0f4a2cb Copy full SHA for 0f4a2cb
File tree 1 file changed +6
-2
lines changed
front-end/h5/src/store/plugins/undo-redo
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ import undoRedoHistory from './History'
5
5
* #!zh: setElementCommonStyle 因为是在 mousemove 时候触发的,执行过于频繁,没有必要计入history,因此需要过滤。
6
6
* 主要记录:拖动完成时候(mouseup)时候的位置、删除元素之前的状态等
7
7
*/
8
- const unRecordHistoryMutationTypes = [ 'editor/setElementCommonStyle' ]
8
+ // const unRecordHistoryMutationTypes = ['editor/setElementCommonStyle']
9
+ const recordHistoryMutationTypes = [
10
+ 'editor/recordRect' ,
11
+ 'editor/elementManager'
12
+ ]
9
13
10
14
const undoRedoPlugin = ( store ) => {
11
15
// initialize and save the starting stage
@@ -15,7 +19,7 @@ const undoRedoPlugin = (store) => {
15
19
16
20
store . subscribe ( ( mutation , state ) => {
17
21
const { type } = mutation
18
- if ( unRecordHistoryMutationTypes . includes ( type ) ) return
22
+ if ( ! recordHistoryMutationTypes . includes ( type ) ) return
19
23
// is called AFTER every mutation
20
24
undoRedoHistory . addState ( cloneDeep ( state ) )
21
25
} )
You can’t perform that action at this time.
0 commit comments