Skip to content

Instantly share code, notes, and snippets.

@hypeJunction
Created April 13, 2019 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hypeJunction/972fb59d21ad87ef53f7a6923a53346f to your computer and use it in GitHub Desktop.
Save hypeJunction/972fb59d21ad87ef53f7a6923a53346f to your computer and use it in GitHub Desktop.
<template>
<div class="component-meta">
<n-box v-if="meta.description">{{ meta.description }}</n-box>
<n-module type="demo" class="component-meta">
<div slot="header"></div>
<n-tabs :items="tabs">
<component-props slot="props" :data="meta.props"></component-props>
<component-slots slot="slots" :data="meta.slots"></component-slots>
<component-events slot="events" :data="meta.events"></component-events>
<component-methods slot="methods" :data="meta.methods"></component-methods>
</n-tabs>
</n-module>
</div>
</template>
<script>
import docs from '../../components/docs.json';
export default {
name: 'ComponentMeta',
props: {
name: {
type: String,
required: true,
},
},
data () {
return {
docs,
};
},
computed: {
meta () {
return this.docs.find(e => e.name === this.name);
},
tabs () {
return [
{
title: 'Props',
target: 'props',
icon: 'fas fa-theater-masks',
},
{
title: 'Slots',
target: 'slots',
icon: 'fas fa-stream',
},
{
title: 'Events',
target: 'events',
icon: 'fas fa-random',
},
{
title: 'Methods',
target: 'methods',
icon: 'fas fa-filter',
},
];
},
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment