2018-05-23 06:44:47 -04:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
active: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
// props can't be updated, so we map it to data where we can
|
|
|
|
localActive: this.active,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
active() {
|
|
|
|
this.localActive = this.active;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.isTab = true;
|
|
|
|
},
|
2018-06-01 16:09:24 -04:00
|
|
|
updated() {
|
|
|
|
this.$parent.$forceUpdate();
|
|
|
|
},
|
2018-05-23 06:44:47 -04:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
class="tab-pane"
|
|
|
|
:class="{
|
|
|
|
active: localActive
|
|
|
|
}"
|
|
|
|
role="tabpanel"
|
|
|
|
>
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|