Open simon-kolkmann opened 1 year ago
Looks like vue already does this with template slots
I had an idea a while ago to force us to make the default rendering possible with slots: #15611
Looked something like this, plus an eslint rule enforcing no outside scope access in the fallback function.
slots.default({ foo, bar, baz }, slotProps => { ...fallback... })
This pattern would also allow comment checks everywhere without all those ugly extra function calls. It did require re-implementing the DefineComponent interface though so maybe a helper function would be better?
renderSlot(slots.default, { foo, bar, baz }, slotProps => { ...fallback... })
People have intentionally been using an empty slot to disable the default though (#17651), using Vue's ensureValidVNode
would probably break that.
Environment
Vuetify Version: 3.3.17 Vue Version: 3.3.4 Browsers: Firefox 117.0 OS: Linux
Steps to reproduce
Please see the reproduction link.
Expected Behavior
Adding a single comment between
<v-data-table>
tags should not prevent the headers and rows from rendering.Actual Behavior
Header and rows don't render, only the footer shows up.
Reproduction Link
https://play.vuetifyjs.com/#...