Skip to content

Should freeze the property passed to component #10

@Javey

Description

@Javey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions