-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Directives in slots aren't resolved in the correct context #541
Labels
bug
Something isn't working
Comments
This was referenced Mar 29, 2023
If a directive is manually imported and in scope then e.g. something like: import vTooltip from './directives/tooltip.js'
const vnode = <button v-tooltip="Hello">OK</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported in discord but it never went anywhere.
🐛 Bug description
https://vue-jsx-explorer.netlify.app/#%3CComp%3E%0A%20%20%7B%7B%0A%20%20%20%20default%3A%20()%20%3D%3E%20%3Cdiv%20v-foo%20%2F%3E%0A%20%20%7D%7D%0A%3C%2FComp%3E
If you run this you get
Cannot read properties of undefined (reading 'deep')
because the directive is being resolved in CompA instead of CompB@yyx990803 said:
🏞 Desired result
The directive should be resolved at the top level rather than inline. I'm not sure if this is even possible because JSX can be used anywhere so there isn't really an easy way to determine what the "render function root scope" is. Maybe slotFlags need to be disabled if a directive is used?
🚑 Other information
Kinda related, implicit default slots don't emit slotFlags:
implicit slot: https://vue-jsx-explorer.netlify.app/#%3CComp%3E%0A%20%20%3Cdiv%20v-foo%20%2F%3E%0A%3C%2FComp%3E
explicit slot: https://vue-jsx-explorer.netlify.app/#%3CComp%3E%0A%20%20%7B%7B%0A%20%20%20%20default%3A%20()%20%3D%3E%20%3Cdiv%20v-foo%20%2F%3E%0A%20%20%7D%7D%0A%3C%2FComp%3E
The text was updated successfully, but these errors were encountered: