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

Should freeze the property passed to component #10

Open
Javey opened this issue Aug 9, 2018 · 0 comments
Open

Should freeze the property passed to component #10

Javey opened this issue Aug 9, 2018 · 0 comments

Comments

@Javey
Copy link
Owner

Javey commented Aug 9, 2018

When we pass a Object to child component, the child component may change the property of that Object. But the $change event can not to be triggered.

class A extends Intact {
     defauts() {
        return {data: {}};
    },
    change() {
        // this set will trigger '$change:data.a' and '$change:data' events
        this.set('data.a', 1);
   }
}
// when the users has changed by `change` method of A component
// we can not get the `$change:user.a` and `$change:user` events
<A data={self.get('user')} />

So we should freeze the property which passed to child component.

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

No branches or pull requests

1 participant