Skip to content
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

v-if cannot access slot scope with new slot syntax #9862

econic opened this Issue Apr 11, 2019 · 1 comment


None yet
2 participants
Copy link

econic commented Apr 11, 2019



Reproduction link

Steps to reproduce

Use a component that defines a scoped slot like this

  <template v-if="" #myslotname="scope">...</template>

What is expected?

The template should evaluate the slot directive first, v-if second. Just as it is done with v-for first, v-if second.

What is actually happening?

The template evaluates the v-if first, resulting in an error (unknown component property)

This functionality was present in the deprecated slot syntax, i stumbled upon it while refactoring to the new one.
It is possible to workaround this with a nested template with the respected v-if

I'm using latest Vue, TypeScript, SFC


This comment has been minimized.

Copy link

posva commented Apr 11, 2019

I couldn't find the duplicate of this but this is now expected behaviour because the v-if has higher priority. As you said, using a nested template is the way to go

@posva posva closed this Apr 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.