mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
docs: warn directives must be registered on both server/client (#22627)
This commit is contained in:
parent
4be2ffe4aa
commit
5492b0638f
@ -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"}
|
||||
|
Loading…
Reference in New Issue
Block a user