move docs to own folder
This commit is contained in:
33
docs/src/components/Tab/index.vue
Normal file
33
docs/src/components/Tab/index.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<pre v-if="formattedCode"><code>{{ formattedCode }}</code></pre>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { outdent } from '@mvasilkov/outdent'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formattedCode: null
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
updateCode() {
|
||||
const text = this.$slots.default[0].text
|
||||
|
||||
if (text) {
|
||||
this.formattedCode = outdent(text)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeUpdate() {
|
||||
this.updateCode()
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.updateCode()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user