Skip to content

Commit

Permalink
feat(#154): add extend props
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Jul 11, 2022
1 parent a31c260 commit 0d79922
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/docgen/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,21 @@ _Note: The contents of this file where automatically generated by the [Druxt Doc
}
})

// Inject extends from vue-docgen-api into jsdoc data.
const prefixId = (templateData[0] || {}).id || ''
// Props.
for (const prop of (data.props || []).filter((prop) => !templateData.map((o) => o.id).includes(`${prefixId}.props.${prop.name}`))) {
templateData.push({
id: `${prefixId}.props.${prop.name}`,
longname: `${prefixId}.props.${prop.name}`,
name: prop.name,
kind: 'member',
scope: 'static',
description: prop.description,
memberof: `${prefixId}.props`
})
}

templateData.map(item => {
const parts = item.id.split('.')
if (item.memberof === null && parts.length > 1) {
Expand Down

0 comments on commit 0d79922

Please sign in to comment.