这是我的代码
parent.hbs
<ChildComp
@value={{this.changes}}
/>
parent.js
export class ParentComponet extends Component {
@tracked this.changes = [1,2,3]
@action addChanges() {
this.changes = [...this.changes, this.changes.length]
}
}
child-comp.js
export class ChildComponet extends Component {
// I wanted to observe this.args.changes updated
// Based on that I need to call some operation
get operation() {
let parent = this.args.values.map((obj) {
if (obj.parent !== null) {
set(obj, 'goal', null);
set(obj, 'newSubGoal', null);
}
});
}
}
我想观察我的孩子组件中的 this.args.changes。我怎样才能以 ember-octane 的方式做到这一点?