bootstrap-vue
Version:
Quickly integrate Bootstrap 4 components with Vue.js
21 lines (20 loc) • 466 B
JavaScript
window.app = new Vue({
el: '#app',
data: {
tabIndex: null, /* Binding to model is optional */
tabs: [],
tabCounter: 0
},
methods: {
closeTab(x) {
for (let i = 0; i < this.tabs.length; i++) {
if (this.tabs[i] === x) {
this.tabs.splice(i, 1);
}
}
},
newTab() {
this.tabs.push(this.tabCounter++);
}
}
});