Closed
Description
Version
2.6.1
Reproduction link
https://jsfiddle.net/3kpf9u54/4/
Steps to reproduce
- Observe the contents of the
<template>
displayed - Change the code from
<template slot="content">
to<template #content>
or<template v-slot:content>
and observe the contents stop being displayed - Change the render function code from
this.$slots.content
tothis.$scopedSlots.content()
and observe the contents be displayed again
What is expected?
Contents are displayed all the time; old render functions don't break when used with new syntax
What is actually happening?
New syntax forces slots into being scoped, breaking existing render functions
I'm actually not sure if this is intentional or not, but it breaks Vuetify, and probably other things too. Assuming this is intentional, it makes writing functional components more difficult, as you have to either:
- check both
this.$slots
(for Vue pre-2.6) andthis.$scopedSlots
(for Vue post-2.6) - only check
this.$scopedSlots
and ask Vue pre-2.6 users to addslot-scope
everywhere so all slots become scoped - only check
this.$slots
and ask Vue post-2.6 users to use the legacy syntax