Skip to content

Commit

Permalink
fix(generator): fix error where value in order is not in category (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengshang918 committed Apr 6, 2022
1 parent 5aa25c5 commit a5290f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/generator/src/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,14 @@ const Generator = forwardRef<GeneratorRef, GeneratorType>(
// 设置左侧组件
useEffect(() => {
if (components) {
setSidebarData(components)
// 过滤order
setSidebarData(
produce(components, (draft) => {
draft.order = draft.order.filter((item) =>
Object.keys(draft.category).includes(item)
)
})
)
} else {
if (customComponents) {
setSidebarData((oldSidebarData) => {
Expand Down

0 comments on commit a5290f8

Please sign in to comment.