diff --git a/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue b/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue index c3715848a6..c2d29383bd 100644 --- a/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue +++ b/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue @@ -35,25 +35,16 @@ }, setup(props) { const snippetConfig = inject('snippetConfig') as SnippetConfig; - const extraParams = ref>({}); - const initialExtraParams = ref>({}); + const extraParams = ref>({}); watch( [() => snippetConfig, () => props.values], () => { - const newExtraParams: Record = {}; - forEach({ ...props.values, ...snippetConfig }, (name, value) => { - if (!props.excludedExtraParams.includes(name)) { - newExtraParams[name] = value; + if (!props.excludedExtraParams.includes(name) && extraParams.value[name] !== value) { + extraParams.value = { ...extraParams.value, [name]: value }; } }); - - // Check if extraParams are really changing to avoid event emission if they don't - if (JSON.stringify(newExtraParams) !== JSON.stringify(initialExtraParams.value)) { - extraParams.value = newExtraParams; - initialExtraParams.value = newExtraParams; - } }, { deep: true,