Skip to content

有几个小错误 #20

@julyL

Description

@julyL
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 }

存在的几点问题

  1. 默认的defaultRule会使得get方法返回值中带有children字段
  2. history.length值应该是this.$records.filter(record => record).length,r3应该为2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions