Created
April 13, 2019 14:04
-
-
Save hypeJunction/972fb59d21ad87ef53f7a6923a53346f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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