Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复使用数组的 pop 和 splice 方法操作数据时,结果错误的问题 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunnyBob
Copy link

问题描述:

// state.data = [1, 2, 3];

const data = produce(state, draftState => {
  draftState.info.age = 26
  draftState.info.career.first.name = '222'
  draftState.data.splice(0, 1)
  draftState.data.pop()
})

当使用如上测试用例时,会产生错误的结果,需在 trap 上添加 deleteProperty 处理解决,望采纳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant