Skip to content

Commit

Permalink
fix wrong type of route id
Browse files Browse the repository at this point in the history
  • Loading branch information
gene9831 committed Jan 7, 2025
1 parent ff9937d commit d7d1c4f
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ if (!Array.isArray(pages.value)) {
const pageToTreeData = (page) => {
const { id, name, isPage, children } = page
if (!Array.isArray(children)) {
return { id, name, isPage, disabled: !isPage }
}
// id 可能为数字,需要转换成字符串
const result = { id: String(id), name, isPage, disabled: !isPage }
return {
id: String(id),
name,
isPage,
disabled: !isPage,
children: children.map((page) => pageToTreeData(page))
if (Array.isArray(children)) {
result.children = children.map((page) => pageToTreeData(page))
}
return result
}
const getNodeIcon = (data) => {
Expand Down

0 comments on commit d7d1c4f

Please sign in to comment.