File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/plugins/materials/src/composable Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import {
2525import meta from '../../meta'
2626import { getBlockCompileRes , getBlockByName , updateBlockCompileCache } from './block-compile'
2727
28- const { camelize, capitalize } = utils
28+ const { camelize, capitalize, deepClone } = utils
2929const { MATERIAL_TYPE } = constants
3030
3131// 这里存放所有TinyVue组件、原生HTML、内置组件的缓存,包含了物料插件面板里所有显示的组件,也包含了没显示的一些联动组件
@@ -113,13 +113,17 @@ const patchBaseProps = (schemaProperties) => {
113113 } )
114114
115115 if ( group ) {
116+ const targetInsertContent = basePropGroup . content . filter (
117+ ( item ) => ! group . content . some ( ( prop ) => prop . property === item . property )
118+ )
119+
116120 if ( insertPosition === 'start' ) {
117- group . content . splice ( 0 , 0 , ...basePropGroup . content )
121+ group . content . splice ( 0 , 0 , ...deepClone ( targetInsertContent ) )
118122 } else {
119- group . content . push ( ...basePropGroup . content )
123+ group . content . push ( ...deepClone ( targetInsertContent ) )
120124 }
121125 } else {
122- schemaProperties . push ( basePropGroup )
126+ schemaProperties . push ( deepClone ( basePropGroup ) )
123127 }
124128 }
125129}
You can’t perform that action at this time.
0 commit comments