Vuetify: [Bug Report] VSkeletonLoader rendering default slot unconditionally

Created on 13 Jan 2020  路  4Comments  路  Source: vuetifyjs/vuetify

Environment

Vuetify Version: 2.2.3
Vue Version: 2.6.11
Browsers: Chrome 79.0.3945.117
OS: Mac OS 10.15.2

Steps to reproduce

  1. Create a skeleton loader
  2. Reference an attribute of an undefined object
  3. See that there is a console error about it

Expected Behavior

V-skeleton-loader works similar to a v-if component and does therefore only render the content in the default slot once the loading flag is false.

Actual Behavior

The undefined object is accessed even when the skeleton loader is still loading. The slot is not rendered conditionally

Reproduction Link

https://codepen.io/ellazlo/pen/GRgGovK

Other comments

Is there any workaround? Is this the intended behaviour? If yes than it's kinda unpractical for data fetching, or am I misunderstanding something here?

VSkeletonLoader bug

All 4 comments

This would happen with any custom component: https://codepen.io/johnjleider/pen/oNgyxWX?editors=1011

If you have any additional questions, please reach out to us in our Discord community.

Vue renders slots when proxying them to this.$slots, so it's still broken unless you use a scoped slot: https://codepen.io/kaelwd/pen/qBEKNYP

This v-slot trick should definitely go into the documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gluons picture gluons  路  3Comments

alterhu2020 picture alterhu2020  路  3Comments

sebastianmacias picture sebastianmacias  路  3Comments

itanka9 picture itanka9  路  3Comments

smousa picture smousa  路  3Comments