Skip to content

Commit 6aefde7

Browse files
authored
fix(slots): prevent errors when slot is empty quasarframework#9547 (quasarframework#9984)
quasarframework#9547
1 parent a013497 commit 6aefde7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ui/src/components/expansion-item/QExpansionItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export default Vue.extend({
171171
let child
172172

173173
if (this.$scopedSlots.header !== void 0) {
174-
child = this.$scopedSlots.header().slice()
174+
child = [].concat(this.$scopedSlots.header())
175175
}
176176
else {
177177
child = [

ui/src/components/popup-edit/QPopupEdit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default Vue.extend({
132132
title = slot(this, 'title', this.title),
133133
child = this.$scopedSlots.default === void 0
134134
? []
135-
: this.$scopedSlots.default(this.defaultSlotScope).slice()
135+
: [].concat(this.$scopedSlots.default(this.defaultSlotScope))
136136

137137
title && child.unshift(
138138
h('div', { staticClass: 'q-dialog__title q-mt-sm q-mb-sm' }, [ title ])

ui/src/components/select/QSelect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ export default Vue.extend({
869869
}
870870

871871
if (this.$scopedSlots.selected !== void 0) {
872-
return this.$scopedSlots.selected().slice()
872+
return [].concat(this.$scopedSlots.selected())
873873
}
874874

875875
if (this.useChips === true) {

ui/src/utils/slot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function slot (vm, slotName, otherwise) {
66

77
export function uniqueSlot (vm, slotName, otherwise) {
88
return vm.$scopedSlots[slotName] !== void 0
9-
? vm.$scopedSlots[slotName]().slice()
9+
? [].concat(vm.$scopedSlots[slotName]())
1010
: otherwise
1111
}
1212

0 commit comments

Comments
 (0)