I have multiple instances of a component being rendered, not at the same time, if you open up a different container, another instance gets rendered. The first instance rendered gets the mounted() triggered but all the other instances don't and they share the same results of that mounted call. How do I separate them? I tried doing "@Watch('prop')" but the first instance of the component doesn't get that method called, since prop hasn't changed.
@Prop() assignee!: Person;
accountName = '';
data(): any {
return {
accountName: '',
}
}
async mounted(): Promise<void> {
this.accountName = ...;
}
so accountName is the same for different instances of the component, since the mounted call didn't get triggered.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/YT4Px3L
Comments
Post a Comment