Skip to content

Commit

Permalink
chore(dynamic-display): sort components props alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Jun 21, 2024
1 parent dd7f2de commit 963c8aa
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/components/docs/dynamic-component-display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,21 @@ const targetPropsForTable = computed(() => {
componentProps = {}
}
return Object.entries(componentProps).reduce((context, [key, value], index) => {
if (value.__hideInPreview) {
return context
}
return Object.assign(context, reactive({
[key]: {
name: key,
type: value.type?.prototype.constructor.name || 'unknown',
allowInput: value.type?.prototype.constructor.name !== 'Function' || false,
'default': value.default,
index
return Object.entries(componentProps).sort(([a], [b]) => a.localeCompare(b))
.reduce((context, [key, value], index) => {
if (value.__hideInPreview) {
return context
}
}))
}, {})
return Object.assign(context, reactive({
[key]: {
name: key,
type: value.type?.prototype.constructor.name || 'unknown',
allowInput: value.type?.prototype.constructor.name !== 'Function' || false,
'default': value.default,
index
}
}))
}, {})
})
const targetEmitsForTable = computed(() => {
Expand Down

0 comments on commit 963c8aa

Please sign in to comment.