UNPKG

626 BPlain TextView Raw
1<template>
2 <div
3 class="theme-code-block"
4 :class="{ 'theme-code-block__active': active }"
5 >
6 <slot />
7 </div>
8</template>
9
10<script>
11export default {
12 name: 'CodeBlock',
13 props: {
14 title: {
15 type: String,
16 required: true
17 },
18 active: {
19 type: Boolean,
20 default: false
21 }
22 },
23 mounted () {
24 if (this.$parent && this.$parent.loadTabs) {
25 this.$parent.loadTabs()
26 }
27 }
28}
29</script>
30
31<style scoped>
32 .theme-code-block {
33 display: none;
34 }
35 .theme-code-block__active {
36 display: block;
37 }
38 .theme-code-block > pre {
39 background-color: orange;
40 }
41</style>