VueJS News
281 subscribers
24 photos
332 links
News, tweets, events and other about VueJS.

Contacts: @c01nd01r
Download Telegram
VueJS News
Live example new $slot variable for scoped slots (will be available for Vue 2.6+) https://codesandbox.io/s/py28wo18qj
- Support $slot variable in all slots. (The presence of $slot causes the slot to be compiled as a scoped slot).

- All slots, including normal slots, are now exposed on this.$scopedSlots as functions. This means assuming this.$slots.default exists, this.$scopedSlots.default() will return its value. This allows render function users to always use this.$scopedSlot and no longer worry about whether the slot being passed in is scoped or not. This is also consistent with 3.0 where all slots are exposed as functions (but on this.$slots instead).

- No change to slot-scope usage, no introduction of new directive. We want to make syntax changes minimal and leave potential breakage to 3.0.

https://github.com/vuejs/vue/issues/9180#issuecomment-452848580