We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
数组simplediff为false,但数据引用变化时,会产生父子组件数据不一致
const Component2 = Regular.extend({ name: 'List', template: "<h1>{list1}</h1>", init() { setTimeout((function () { // 1. 实际也修改了parent.list对应的watcher里的last??? this.data.list1[0] = 99 // 2. 此时,Parent#list 值是 [] , 但是last变成了[99]。 深坑 this.$update(); expect(this.data.list1).to.eql([99]) // 实际是[] done() }).bind(this), 0); } }); const Component = Regular.extend({ name: 'Parent', template: ` <List list1={list}/> `, config() { this.data.list = []; // this.data.list = [1] }, init() { this.data.list = []; // this.data.list = [1] //同样会出错 // 这个update 由于list并没有判断为改变,所以last还是原来的数组,此时List再修改就会导致出错 this.$update(); } }); new Component().$inject('body'); })
The text was updated successfully, but these errors were encountered:
fix: #245
9f5a69c
0.6.3发
Sorry, something went wrong.
No branches or pull requests
数组simplediff为false,但数据引用变化时,会产生父子组件数据不一致
The text was updated successfully, but these errors were encountered: