Blame view

node_modules/bootstrap-vue/esm/components/nav/nav.js 2.17 KB
4cd4fd28   郭伟龙   feat: 初始化项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 { extend, mergeData } from '../../vue';
import { NAME_NAV } from '../../constants/components';
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';
import { makeProp, makePropsConfigurable } from '../../utils/props'; // --- Helper methods ---

var computeJustifyContent = function computeJustifyContent(value) {
  value = value === 'left' ? 'start' : value === 'right' ? 'end' : value;
  return "justify-content-".concat(value);
}; // --- Props ---


export var props = makePropsConfigurable({
  align: makeProp(PROP_TYPE_STRING),
  // Set to `true` if placing in a card header
  cardHeader: makeProp(PROP_TYPE_BOOLEAN, false),
  fill: makeProp(PROP_TYPE_BOOLEAN, false),
  justified: makeProp(PROP_TYPE_BOOLEAN, false),
  pills: makeProp(PROP_TYPE_BOOLEAN, false),
  small: makeProp(PROP_TYPE_BOOLEAN, false),
  tabs: makeProp(PROP_TYPE_BOOLEAN, false),
  tag: makeProp(PROP_TYPE_STRING, 'ul'),
  vertical: makeProp(PROP_TYPE_BOOLEAN, false)
}, NAME_NAV); // --- Main component ---
// @vue/component

export var BNav = /*#__PURE__*/extend({
  name: NAME_NAV,
  functional: true,
  props: props,
  render: function render(h, _ref) {
    var _class;

    var props = _ref.props,
        data = _ref.data,
        children = _ref.children;
    var tabs = props.tabs,
        pills = props.pills,
        vertical = props.vertical,
        align = props.align,
        cardHeader = props.cardHeader;
    return h(props.tag, mergeData(data, {
      staticClass: 'nav',
      class: (_class = {
        'nav-tabs': tabs,
        'nav-pills': pills && !tabs,
        'card-header-tabs': !vertical && cardHeader && tabs,
        'card-header-pills': !vertical && cardHeader && pills && !tabs,
        'flex-column': vertical,
        'nav-fill': !vertical && props.fill,
        'nav-justified': !vertical && props.justified
      }, _defineProperty(_class, computeJustifyContent(align), !vertical && align), _defineProperty(_class, "small", props.small), _class)
    }), children);
  }
});