Skip to content

Commit

Permalink
docs: warn directives must be registered on both server/client (#22627)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 14, 2023
1 parent 4be2ffe commit 5492b06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/2.guide/2.directory-structure/1.plugins.md
Expand Up @@ -223,4 +223,8 @@ export default defineNuxtPlugin((nuxtApp) => {
})
```

::alert{type=warning}
If you register a Vue directive, you _must_ register it on both client and server side unless you are only using it when rendering one side. If the directive only makes sense from a client side, you can always move it to `~/plugins/my-directive.client.ts` and provide a 'stub' directive for the server in `~/plugins/my-directive.server.ts`.
::

:ReadMore{link="https://vuejs.org/guide/reusability/custom-directives.html"}

0 comments on commit 5492b06

Please sign in to comment.