vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.57k stars 33.66k forks source link

Can't use the new v-slot syntax inside a template tag that is there only for conditional purposes #10188

Open wojtiku opened 5 years ago

wojtiku commented 5 years ago

Version

2.6.10

Reproduction link

https://codesandbox.io/s/vue-template-9r28t

Steps to reproduce

Visit the repo and check out the template compilation error for App.vue. Remove the <template v-else> to get rid of the error.

What is expected?

The template compiles properly

What is actually happening?

The template doesn't comiple


Vue should allow to use slots inside a template tag that is inside component. Without this, the new slot syntax severely limits how one can put content into slots in more complex scenarios and forces repeating yourself on multiple template tags.

posva commented 5 years ago

Duplicate of https://github.com/vuejs/vue/issues/7904

posva commented 5 years ago

I'm confused because it doesn't work with the old syntax either, but it sounds like it did work for you with the old syntax

wojtiku commented 5 years ago

Now I am confused. It works with the old syntax. This is the same code as above just the slot syntax is different: https://codesandbox.io/s/vue-template-crbwt

Sorry for a duplicate, I haven't found it even though I was looking for it.

posva commented 5 years ago

My bad, I was using both syntaxes at the same time. The other issue now works, so I'm not sure about so maybe it was reconsidered later and something is missing in the new implementation