Skip to content

Commit

Permalink
perf: Generate component description to markdown
Browse files Browse the repository at this point in the history
fix #26
  • Loading branch information
HcySunYang committed Jan 13, 2019
1 parent 96d6b12 commit 752f2b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/cli/lib/genMarkdownTemp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export default function(parserRes: ParserResult) {
let templateStr = '# [name]\n\n'
let original = templateStr

if (parserRes.componentDesc && parserRes.componentDesc.length) {
templateStr += `${parserRes.componentDesc.join('')}\n\n`
}

templateStr += parserRes.props ? genBaseTemplate('props') : ''
templateStr += parserRes.events ? genBaseTemplate('events') : ''
templateStr += parserRes.slots ? genBaseTemplate('slots') : ''
Expand Down
1 change: 1 addition & 0 deletions packages/parser/__test__/__fixtures__/all.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</template>

<script>
// This is a description of the component
export default {
props: {
// The name of the form, up to 8 characters
Expand Down

0 comments on commit 752f2b1

Please sign in to comment.