UNPKG

bootstrap-vue

Version:

BootstrapVue, with more than 85 custom components, over 45 plugins, several custom directives, and over 300 icons, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated W

21 lines (19 loc) 917 B
import { hasNormalizedSlot as _hasNormalizedSlot, normalizeSlot as _normalizeSlot } from '../utils/normalize-slot'; import { concat } from '../utils/array'; export default { methods: { hasNormalizedSlot: function hasNormalizedSlot(names) { // Returns true if the either a $scopedSlot or $slot exists with the specified name // `names` can be a string name or an array of names return _hasNormalizedSlot(names, this.$scopedSlots, this.$slots); }, normalizeSlot: function normalizeSlot(names) { var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // Returns an array of rendered VNodes if slot found. // Returns undefined if not found. // `names` can be a string name or an array of names var vNodes = _normalizeSlot(names, scope, this.$scopedSlots, this.$slots); return vNodes ? concat(vNodes) : vNodes; } } };