Add custom directive to Vue3 #1028
Answered
by
RobertBoes
rico
asked this question in
Help (Vue)
-
I try to add a custom directive to the vue 3 instance. Tried the following approach:
But this leads to the error: Cannot read properties of undefined (reading 'deep') Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Answered by
RobertBoes
Dec 29, 2021
Replies: 1 comment 2 replies
-
You should add the directive before the app is mounted, so like this app.directive('autofocus', {
// ...
})
app.mount(el) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rico
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should add the directive before the app is mounted, so like this