Skip to content

Commit 82a9b67

Browse files
committed
fix(VDialog,VMenu,VTooltip): work around vue 2.6.2 $slots change
see vuejs/vue#9421
1 parent e5f60d4 commit 82a9b67

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

packages/vuetify/src/components/VDialog/VDialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default {
192192
}
193193
}
194194

195-
if (this.$scopedSlots.activator && !this.$slots.activator) {
195+
if (this.$scopedSlots.activator && this.$scopedSlots.activator.length) {
196196
const activator = this.$scopedSlots.activator({ on: listeners })
197197
this.activatorNode = activator
198198
return activator
@@ -204,7 +204,7 @@ export default {
204204
'v-dialog__activator--disabled': this.disabled
205205
},
206206
on: listeners
207-
}, [this.$slots.activator])
207+
}, this.$slots.activator)
208208
}
209209
},
210210

packages/vuetify/src/components/VMenu/mixins/menu-generators.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,21 @@ export default {
1515
}
1616
}
1717

18-
if (this.$slots.activator) {
19-
const options = {
20-
staticClass: 'v-menu__activator',
21-
'class': {
22-
'v-menu__activator--active': this.hasJustFocused || this.isActive,
23-
'v-menu__activator--disabled': this.disabled
24-
},
25-
ref: 'activator',
26-
on: listeners
27-
}
28-
29-
return this.$createElement('div', options, this.$slots.activator)
30-
} else if (this.$scopedSlots.activator) {
18+
if (this.$scopedSlots.activator && this.$scopedSlots.activator.length) {
3119
const activator = this.$scopedSlots.activator({ on: listeners })
3220
this.activatorNode = activator
3321
return activator
3422
}
23+
24+
return this.$createElement('div', {
25+
staticClass: 'v-menu__activator',
26+
'class': {
27+
'v-menu__activator--active': this.hasJustFocused || this.isActive,
28+
'v-menu__activator--disabled': this.disabled
29+
},
30+
ref: 'activator',
31+
on: listeners
32+
}, this.$slots.activator)
3533
},
3634

3735
genTransition () {

packages/vuetify/src/components/VTooltip/VTooltip.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@ export default {
158158
}
159159
}
160160

161-
if (this.$slots.activator) {
162-
return this.$createElement('span', {
163-
on: listeners,
164-
ref: 'activator'
165-
}, this.$slots.activator)
166-
} else if (this.$scopedSlots.activator) {
161+
if (this.$scopedSlots.activator && this.$scopedSlots.activator.length) {
167162
const activator = this.$scopedSlots.activator({ on: listeners })
168163
this.activatorNode = activator
169164
return activator
170165
}
166+
167+
return this.$createElement('span', {
168+
on: listeners,
169+
ref: 'activator'
170+
}, this.$slots.activator)
171171
}
172172
},
173173

0 commit comments

Comments
 (0)