+1 vote
in VueJS by

What are the hook functions provided by directives?

1 Answer

0 votes
by

A directive object can provide several hook functions,

bind: This occurs once the directive is attached to the element.

inserted: This hook occurs once the element is inserted into the parent DOM.

update: This hook is called when the element updates, but children haven't been updated yet.

componentUpdated: This hook is called once the component and the children have been updated.

unbind: This hook is called only once when the directive is removed.

Note: There are several arguments that can be passed to the above hooks.

Related questions

0 votes
asked Oct 21, 2019 in VueJS by Tate
0 votes
asked Feb 4, 2020 in VueJS by rajeshsharma
...