diff options
Diffstat (limited to '')
| -rw-r--r-- | doc/docs/.vuepress/theme/global-components/CodeBlock.vue | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/docs/.vuepress/theme/global-components/CodeBlock.vue b/doc/docs/.vuepress/theme/global-components/CodeBlock.vue new file mode 100644 index 0000000..d59d85b --- /dev/null +++ b/doc/docs/.vuepress/theme/global-components/CodeBlock.vue | |||
| @@ -0,0 +1,41 @@ | |||
| 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> | ||
| 11 | export 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> | ||
