Skip to content

Commit

Permalink
fix: defaultValue error
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Aug 9, 2024
1 parent ae55b32 commit 195086a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export function propsReducer(uiName: string, map: string[], prefix: string, icon
tableDivider,
...Object.keys(item.props).map((name) => {
const { default: defaultValue = '', type, description, description_zh } = item.props[name]
let value = defaultValue.replace(/\s+/g, ' ').replace(/\|/g, ' \\| ').trim()
let value = String(defaultValue).replace(/\s+/g, ' ').replace(/\|/g, ' \\| ').trim()
value = defaultValue.length > 20 ? '...' : value
return `| \`${name}\` | \`${isZh ? description_zh : description}\` | \`${type}\` | \`${value}\` |`
}),
Expand Down

0 comments on commit 195086a

Please sign in to comment.