Skip to content

Commit

Permalink
fix: filter duplicated property
Browse files Browse the repository at this point in the history
  • Loading branch information
chilingling committed Dec 28, 2024
1 parent c95144f commit 8674bd0
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 @@ -113,10 +113,14 @@ const patchBaseProps = (schemaProperties) => {
})

if (group) {
const targetInsertContent = basePropGroup.content.filter(
(item) => !group.content.some((prop) => prop.property === item.property)
)

if (insertPosition === 'start') {
group.content.splice(0, 0, ...deepClone(basePropGroup.content))
group.content.splice(0, 0, ...deepClone(targetInsertContent))
} else {
group.content.push(...deepClone(basePropGroup.content))
group.content.push(...deepClone(targetInsertContent))
}
} else {
schemaProperties.push(deepClone(basePropGroup))
Expand Down

0 comments on commit 8674bd0

Please sign in to comment.