Skip to content

Commit

Permalink
refactor(useMaterials): review bot
Browse files Browse the repository at this point in the history
  • Loading branch information
wenmine committed Jun 30, 2024
1 parent 05ec9dd commit fbbc05c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/plugins/materials/src/composable/useMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ const componentState = reactive({
})
const getSnippet = (component) => {
let schema = {}
materialState.components.forEach(({ children }) => {
materialState.components.some(({ children }) => {
const child = children.find(({ snippetName }) => snippetName === component)
child && (schema = child.schema)
if (child) {
schema = child.schema
return true
}
return false
})

return schema
Expand Down

0 comments on commit fbbc05c

Please sign in to comment.