Merge pull request #13636 from dataease/pr@dev-v2@refactor_style-set

fix: 修复样式设置时可能出现的样式影响其他组件问题 #13299
This commit is contained in:
王嘉豪 2024-11-28 13:21:20 +08:00 committed by GitHub
commit b5dda58118
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1102,15 +1102,21 @@ const onFunctionCfgChange = val => {
} }
const onBackgroundChange = val => { const onBackgroundChange = val => {
// #13299
if (curComponent.value.id === view.value?.id) {
curComponent.value.commonBackground = val curComponent.value.commonBackground = val
if (mobileInPc.value) { if (mobileInPc.value) {
// //
useEmitt().emitter.emit('onMobileStatusChange', { useEmitt().emitter.emit('onMobileStatusChange', {
type: 'componentStyleChange', type: 'componentStyleChange',
value: { type: 'commonBackground', component: JSON.parse(JSON.stringify(curComponent.value)) } value: {
type: 'commonBackground',
component: JSON.parse(JSON.stringify(curComponent.value))
}
}) })
} }
} }
}
const onStyleAttrChange = val => { const onStyleAttrChange = val => {
curComponent.value.style[val.property] = val.value curComponent.value.style[val.property] = val.value