bootstrap-vue
Version:
BootstrapVue, with over 40 plugins and more than 75 custom components, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
18 lines (16 loc) • 619 B
JavaScript
import { hasNormalizedSlot, normalizeSlot } from '../utils/normalize-slot'
import { concat } from '../utils/array'
export default {
methods: {
hasNormalizedSlot(name) {
// Returns true if the either a $scopedSlot or $slot exists with the specified name
return hasNormalizedSlot(name, this.$scopedSlots, this.$slots)
},
normalizeSlot(name, scope = {}) {
// Returns an array of rendered vNodes if slot found.
// Returns undefined if not found.
const vNodes = normalizeSlot(name, scope, this.$scopedSlots, this.$slots)
return vNodes ? concat(vNodes) : vNodes
}
}
}