Skip to content

Commit

Permalink
fix(VDialog,VMenu,VTooltip): work around vue 2.6.2 $slots change
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Feb 5, 2019
1 parent e5f60d4 commit 82a9b67
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VDialog/VDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default {
}
}

if (this.$scopedSlots.activator && !this.$slots.activator) {
if (this.$scopedSlots.activator && this.$scopedSlots.activator.length) {
const activator = this.$scopedSlots.activator({ on: listeners })
this.activatorNode = activator
return activator
Expand All @@ -204,7 +204,7 @@ export default {
'v-dialog__activator--disabled': this.disabled
},
on: listeners
}, [this.$slots.activator])
}, this.$slots.activator)
}
},

Expand Down
24 changes: 11 additions & 13 deletions packages/vuetify/src/components/VMenu/mixins/menu-generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@ export default {
}
}

if (this.$slots.activator) {
const options = {
staticClass: 'v-menu__activator',
'class': {
'v-menu__activator--active': this.hasJustFocused || this.isActive,
'v-menu__activator--disabled': this.disabled
},
ref: 'activator',
on: listeners
}

return this.$createElement('div', options, this.$slots.activator)
} else if (this.$scopedSlots.activator) {
if (this.$scopedSlots.activator && this.$scopedSlots.activator.length) {
const activator = this.$scopedSlots.activator({ on: listeners })
this.activatorNode = activator
return activator
}

return this.$createElement('div', {
staticClass: 'v-menu__activator',
'class': {
'v-menu__activator--active': this.hasJustFocused || this.isActive,
'v-menu__activator--disabled': this.disabled
},
ref: 'activator',
on: listeners
}, this.$slots.activator)
},

genTransition () {
Expand Down
12 changes: 6 additions & 6 deletions packages/vuetify/src/components/VTooltip/VTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,16 @@ export default {
}
}

if (this.$slots.activator) {
return this.$createElement('span', {
on: listeners,
ref: 'activator'
}, this.$slots.activator)
} else if (this.$scopedSlots.activator) {
if (this.$scopedSlots.activator && this.$scopedSlots.activator.length) {
const activator = this.$scopedSlots.activator({ on: listeners })
this.activatorNode = activator
return activator
}

return this.$createElement('span', {
on: listeners,
ref: 'activator'
}, this.$slots.activator)
}
},

Expand Down

0 comments on commit 82a9b67

Please sign in to comment.