Skip to content

Commit

Permalink
fix(VImg): accept scopedSlots
Browse files Browse the repository at this point in the history
fixes #14686
  • Loading branch information
KaelWD committed Mar 24, 2022
1 parent 71c2b1f commit 96888d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/vuetify/src/components/VImg/VImg.ts
Expand Up @@ -18,6 +18,7 @@ import Themeable from '../../mixins/themeable'
import mixins from '../../util/mixins'
import mergeData from '../../util/mergeData'
import { consoleWarn } from '../../util/console'
import { getSlot } from '../../util/helpers'

// not intended for public use, this is passed in by vuetify-loader
export interface srcObject {
Expand Down Expand Up @@ -250,11 +251,12 @@ export default mixins(
return content
},
__genPlaceholder (): VNode | void {
if (this.$slots.placeholder) {
const slot = getSlot(this, 'placeholder')
if (slot) {
const placeholder = this.isLoading
? [this.$createElement('div', {
staticClass: 'v-image__placeholder',
}, this.$slots.placeholder)]
}, slot)]
: []

if (!this.transition) return placeholder[0]
Expand Down
3 changes: 2 additions & 1 deletion packages/vuetify/src/components/VResponsive/VResponsive.ts
Expand Up @@ -8,6 +8,7 @@ import { VNode } from 'vue'

// Utils
import mixins from '../../util/mixins'
import { getSlot } from '../../util/helpers'

/* @vue/component */
export default mixins(Measurable).extend({
Expand Down Expand Up @@ -42,7 +43,7 @@ export default mixins(Measurable).extend({
return this.$createElement('div', {
staticClass: 'v-responsive__content',
class: this.contentClass,
}, this.$slots.default)
}, getSlot(this))
},
},

Expand Down

0 comments on commit 96888d5

Please sign in to comment.