bootstrap-vue
Version:
BootstrapVue, with over 40 plugins and more than 80 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.
58 lines (55 loc) • 1.78 kB
JavaScript
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import Vue from '../../utils/vue';
import { mergeData } from 'vue-functional-data-merge';
import { arrayIncludes } from '../../utils/array';
var COMMON_ALIGNMENT = ['start', 'end', 'center'];
export var props = {
tag: {
type: String,
default: 'div'
},
noGutters: {
type: Boolean,
default: false
},
alignV: {
type: String,
default: null,
validator: function validator(str) {
return arrayIncludes(COMMON_ALIGNMENT.concat(['baseline', 'stretch']), str);
}
},
alignH: {
type: String,
default: null,
validator: function validator(str) {
return arrayIncludes(COMMON_ALIGNMENT.concat(['between', 'around']), str);
}
},
alignContent: {
type: String,
default: null,
validator: function validator(str) {
return arrayIncludes(COMMON_ALIGNMENT.concat(['between', 'around', 'stretch']), str);
}
}
}; // @vue/component
export var BRow =
/*#__PURE__*/
Vue.extend({
name: 'BRow',
functional: true,
props: props,
render: function render(h, _ref) {
var _class;
var props = _ref.props,
data = _ref.data,
children = _ref.children;
return h(props.tag, mergeData(data, {
staticClass: 'row',
class: (_class = {
'no-gutters': props.noGutters
}, _defineProperty(_class, "align-items-".concat(props.alignV), props.alignV), _defineProperty(_class, "justify-content-".concat(props.alignH), props.alignH), _defineProperty(_class, "align-content-".concat(props.alignContent), props.alignContent), _class)
}), children);
}
});