diff --git a/editor/inspector/contributions/node.js b/editor/inspector/contributions/node.js index 31b0adf90e..7b4e38758d 100644 --- a/editor/inspector/contributions/node.js +++ b/editor/inspector/contributions/node.js @@ -1473,7 +1473,7 @@ exports.methods = { const lastIndex = length - 1; const lastComp = nodeDump.__comps__[lastIndex]; - if (lastComp && lastComp.type === clipboardComponentInfo.type) { + if (lastComp?.cid === clipboardComponentInfo.cid) { await Editor.Message.request('scene', 'set-property', { uuid, path: `__comps__.${lastIndex}`, @@ -1596,7 +1596,7 @@ exports.methods = { const lastIndex = length - 1; const lastComp = nodeDump.__comps__[lastIndex]; - if (lastComp && lastComp.type === clipboardComponentInfo.type) { + if (lastComp?.cid === clipboardComponentInfo.cid) { await Editor.Message.request('scene', 'set-property', { uuid, path: `__comps__.${lastIndex}`,