[Vuejs]-Vue – timing of child computed vs. parent computed

1👍

This scenario generally shouldn’t be allowed because this may in unintended race condition. The order in which parent and children components are updated is not documented but can be observed based on the actual behaviour.

mounted lifecycle is known to be ordered from a child to a parent, so update could be expected to be ordered the same way. Also v-if can provide additional delay because the changes are applied on component update.

v-if can be either moved to a child, or a value that a child depends can be passed through a prop instead of being accessed from a store directly, since it’s already available in parent template and used in v-if.

Leave a comment