aboutsummaryrefslogtreecommitdiff
path: root/doc/docs/.vuepress/theme/global-components/CodeBlock.vue
blob: d59d85b26ae480f7c73b0fdd5a5b28e94b9660e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
  <div
    class="theme-code-block"
    :class="{ 'theme-code-block__active': active }"
  >
    <slot />
  </div>
</template>

<script>
export default {
  name: 'CodeBlock',
  props: {
    title: {
      type: String,
      required: true
    },
    active: {
      type: Boolean,
      default: false
    }
  },
  mounted () {
    if (this.$parent && this.$parent.loadTabs) {
      this.$parent.loadTabs()
    }
  }
}
</script>

<style scoped>
  .theme-code-block {
    display: none;
  }
  .theme-code-block__active {
    display: block;
  }
  .theme-code-block > pre {
    background-color: orange;
  }
</style>