hmol233 dcbd1d3e51
Upgrade vuepress to beta.15
- use official dark theme
- fix: Fix Tabs
2021-05-28 22:11:48 +08:00

42 lines
727 B
Vue

<template>
<div
class="tab-pane fade"
:id="tabID"
role="tabpanel"
:aria-labelledby="labelID"
>
<slot />
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
props: {
title: {
type: String,
},
},
data() {
let tag = this.title;
return {
tabID: tag,
};
},
mounted() {
this.tabID = "tab-" + Math.random().toString(36).substring(2);
this.$parent.$data.children.push({ id: this.tabID, title: this.title });
},
computed: {
labelID(): String {
return this.tabID + "-label";
},
},
});
</script>
<style lang="scss" scoped>
@import "node_modules/bootstrap/scss/bootstrap";
</style>