Skip to content

Commit

Permalink
fix(VBanner): remove cached slot
Browse files Browse the repository at this point in the history
allow user to toggle the actions slot with v-if
  • Loading branch information
johnleider committed Dec 4, 2019
1 parent 56d47f0 commit 1d62d23
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/vuetify/src/components/VBanner/VBanner.ts
Expand Up @@ -13,11 +13,14 @@ import { VExpandTransition } from '../transitions'
import Toggleable from '../../mixins/toggleable'

// Utilities
import { convertToUnit } from '../../util/helpers'
import mixins from '../../util/mixins'
import {
convertToUnit,
getSlot,
} from '../../util/helpers'

// Types
import { VNode } from 'vue/types'
import mixins from '../../util/mixins'
import { PropValidator } from 'vue/types/options'

/* @vue/component */
Expand Down Expand Up @@ -59,9 +62,6 @@ export default mixins(
'v-banner--sticky': this.isSticky,
}
},
hasActions (): boolean {
return Boolean(this.$slots.actions || this.$scopedSlots.actions)
},
hasIcon (): boolean {
return Boolean(this.icon || this.$slots.icon)
},
Expand Down Expand Up @@ -129,11 +129,11 @@ export default mixins(
}, this.$slots.default)
},
genActions () {
if (!this.hasActions) return undefined

const children = this.$scopedSlots.actions ? this.$scopedSlots.actions({
const children = getSlot(this, 'actions', {
dismiss: () => this.isActive = false,
}) : this.$slots.actions
})

if (!children) return undefined

return this.$createElement('div', {
staticClass: 'v-banner__actions',
Expand Down

0 comments on commit 1d62d23

Please sign in to comment.