-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
const history = new History()
const state = { a: 1, b: 2 }
history.pushSync({ ...state })
history.pushSync({ ...state, ...{ a: 2 } })
history.pushSync({ ...state, ...{ a: 3 } });
history.undo();
history.undo();
let r1 = history.get(); // { a: 1, b: 2, children: undefined }
history.pushSync({ ...state, ...{ c: 1 } });
let r2 = history.get();
let r3 = history.length; // 3 应该等于2
history.undo();
let r4 = history.get(); // { a: 1, b: 2, children: undefined }
存在的几点问题
- 默认的defaultRule会使得get方法返回值中带有children字段
- history.length值应该是this.$records.filter(record => record).length,r3应该为2
xiaoluoboding, doodlewind and eric-gitta-moore
Metadata
Metadata
Assignees
Labels
No labels