Skip to content

Commit 74b39ed

Browse files
committed
Merge branch 'master' into popover-refactor
2 parents 4bec798 + d43c09a commit 74b39ed

File tree

5 files changed

+27
-19
lines changed

5 files changed

+27
-19
lines changed

lib/components/card.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@
5656
}
5757
},
5858
cardAlign() {
59-
return `text-${this.align}`;
59+
return this.align ? `text-${this.align}` : null;
6060
}
6161
},
6262
props: {
6363
align: {
6464
type: String,
65-
default: 'left'
65+
default: null
6666
},
6767
inverse: {
6868
type: Boolean,

lib/components/collapse.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<transition name="collapse">
2+
<transition @enter="enter" @leave="leave" name="collapse">
33
<div :class="classObject" v-show="show">
44
<slot></slot>
55
</div>
@@ -10,11 +10,10 @@
1010
.collapse-enter-active, .collapse-leave-active {
1111
transition: all .35s ease;
1212
overflow: hidden;
13-
max-height: 100vh;
1413
}
1514
1615
.collapse-enter, .collapse-leave-to {
17-
max-height: 0;
16+
height: 0;
1817
}
1918
</style>
2019

@@ -50,6 +49,16 @@
5049
methods: {
5150
toggle() {
5251
this.show = !this.show;
52+
},
53+
enter(el) {
54+
let height = 0;
55+
Array.prototype.forEach.call(el.children, c => {
56+
height += parseInt(getComputedStyle(c).height, 10);
57+
});
58+
el.style.height = `${height}px`;
59+
},
60+
leave(el) {
61+
el.style.height = null;
5362
}
5463
},
5564

lib/components/nav-item.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<li class="nav-item" @click="onclick">
3-
<b-link :class="classObject" :to="to" :href="href" :exact="exact">
3+
<b-link :is="itemType" :class="classObject" :to="to" :href="href" :exact="exact">
44
<slot></slot>
55
</b-link>
66
</li>
@@ -12,6 +12,9 @@
1212
export default {
1313
components: {bLink},
1414
computed: {
15+
itemType() {
16+
return (this.href || this.to) ? 'b-link' : 'button';
17+
},
1518
classObject() {
1619
return [
1720
'nav-link',

lib/components/tabs.vue

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<slot name="tabs"></slot>
1616
</ul>
1717
</div>
18-
<div :class="['tab-content',{'card-block': card}]">
18+
<div :class="['tab-content',{'card-block': card}]" ref="tabsContainer">
1919
<slot></slot>
2020
<slot name="empty" v-if="!tabs || !tabs.length"></slot>
2121
</div>
@@ -144,7 +144,7 @@
144144
/**
145145
* Dynamically update tabs
146146
*/
147-
_updateTabs() {
147+
updateTabs() {
148148
// Probe tabs
149149
if (this.$slots.default) {
150150
this.tabs = this.$slots.default.filter(tab => tab.componentInstance || false)
@@ -169,23 +169,19 @@
169169
});
170170
}
171171
172-
this.setTab(tabIndex, true);
173-
},
172+
// Workaround to fix problem when currentTab is removed
173+
if (tabIndex > this.tabs.length - 1) {
174+
tabIndex = this.tabs.length - 1;
175+
}
174176
175-
/**
176-
* Wait for next tick so we can ensure DOM is updated before we inspect it
177-
*/
178-
updateTabs() {
179-
this.$nextTick(() => {
180-
this._updateTabs();
181-
});
177+
this.setTab(tabIndex || 0, true);
182178
}
183179
},
184180
mounted() {
185181
this.updateTabs();
186182
187183
// Observe Child changes so we can notify tabs change
188-
observeDom(this.$el, this.updateTabs.bind(this), {subtree: false});
184+
observeDom(this.$refs.tabsContainer, this.updateTabs.bind(this), {subtree: false});
189185
}
190186
};
191187

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bootstrap-vue",
3-
"version": "0.12.2",
3+
"version": "0.12.3",
44
"description": "Bootstrap 4 Components for Vue.js 2",
55
"main": "dist/bootstrap-vue.common.js",
66
"web": "dist/bootstrap-vue.js",

0 commit comments

Comments
 (0)