Skip to content

Commit

Permalink
docs: align custom-directive example with content (#3093)
Browse files Browse the repository at this point in the history
docs:  align example description with content
  • Loading branch information
biomousavi authored Nov 19, 2024
1 parent b266b81 commit 6e1090c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/guide/reusability/custom-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ In addition to the default set of directives shipped in core (like `v-model` or

We have introduced two forms of code reuse in Vue: [components](/guide/essentials/component-basics) and [composables](./composables). Components are the main building blocks, while composables are focused on reusing stateful logic. Custom directives, on the other hand, are mainly intended for reusing logic that involves low-level DOM access on plain elements.

A custom directive is defined as an object containing lifecycle hooks similar to those of a component. The hooks receive the element the directive is bound to. Here is an example of a directive that focuses an input when the element is inserted into the DOM by Vue:
A custom directive is defined as an object containing lifecycle hooks similar to those of a component. The hooks receive the element the directive is bound to. Here is an example of a directive that adds a class to an element when it is inserted into the DOM by Vue:

<div class="composition-api">

Expand Down

0 comments on commit 6e1090c

Please sign in to comment.