custom-bootstrap-vue
Version:
Custom version of bootstrap-vue created for providing specific theme to a particular project
38 lines (35 loc) • 1.04 kB
JavaScript
import { mergeData } from 'vue-functional-data-merge';
import Vue from '../../utils/vue';
import { normalizeSlot } from '../../utils/normalize-slot';
var NAME = 'BSkeletonWrapper'; // @vue/component
export var BSkeletonWrapper = /*#__PURE__*/Vue.extend({
name: NAME,
functional: true,
props: {
loading: {
type: Boolean,
default: false
}
},
render: function render(h, _ref) {
var data = _ref.data,
props = _ref.props,
slots = _ref.slots,
scopedSlots = _ref.scopedSlots;
var $slots = slots();
var $scopedSlots = scopedSlots || {};
var slotScope = {};
if (props.loading) {
return h('div', mergeData(data, {
attrs: {
role: 'alert',
'aria-live': 'polite',
'aria-busy': true
},
staticClass: 'b-skeleton-wrapper',
key: 'loading'
}), [normalizeSlot('loading', slotScope, $scopedSlots, $slots) || h()]);
}
return normalizeSlot('default', slotScope, $scopedSlots, $slots) || h();
}
});