What are the specific application scenarios of update and componentUpdated for vue custom instructions?

update: called when the VNode of the component in which it is located is updated, but may occur before its child VNode update. The value of the instruction may or may not have changed. But you can ignore unnecessary template updates by comparing the values before and after updates

componentUpdated: called after the VNode and its child VNode of the component where the instruction is located are all updated.

there is nothing wrong with reading these instructions. The component calls the update hook as soon as it is updated, and then calls componentUpdated after the update. However, I don"t understand what scenario can only use update, not componentUpdated

.
May.10,2022

my understanding is that I want to quickly determine whether the parent component is updated, regardless of whether the child component is updated, and use it when there are strict response time requirements.

Menu