Skip to content

Commit f46b5d8

Browse files
authored
fix($bvToast,$bvModal): ensure values passed to slots are arrays for Vue.js 2.5.x compatibility (closes bootstrap-vue#3174) (bootstrap-vue#3252)
1 parent afb5519 commit f46b5d8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/modal/helpers/bv-modal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import Vue from '../../../utils/vue'
66
import BModal, { props as modalProps } from '../modal'
7+
import { concat } from '../../../utils/array'
78
import { getComponentConfig } from '../../../utils/config'
89
import { isUndefined, isFunction } from '../../../utils/inspect'
910
import {
@@ -129,7 +130,7 @@ const asyncMsgBox = (props, $parent, resolver = defaultResolver) => {
129130
if (!isUndefined(props[prop])) {
130131
// Can be a string, or array of VNodes.
131132
// Alternatively, user can use HTML version of prop to pass an HTML string.
132-
msgBox.$slots[propsToSlots[prop]] = props[prop]
133+
msgBox.$slots[propsToSlots[prop]] = concat(props[prop])
133134
}
134135
})
135136

src/components/toast/helpers/bv-toast.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import Vue from '../../../utils/vue'
6+
import { concat } from '../../../utils/array'
67
import { getComponentConfig } from '../../../utils/config'
78
import { requestAF } from '../../../utils/dom'
89
import { isUndefined, isString } from '../../../utils/inspect'
@@ -122,7 +123,8 @@ const makeToast = (props, $parent) => {
122123
// Special case for title if it is a string, we wrap in a <strong>
123124
value = [$parent.$createElement('strong', { class: 'mr-2' }, value)]
124125
}
125-
toast.$slots[propsToSlots[prop]] = value
126+
// Make sure slot value is an array for Vue 2.5.x compatability
127+
toast.$slots[propsToSlots[prop]] = concat(value)
126128
}
127129
})
128130

0 commit comments

Comments
 (0)