diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index 68195e2df..fa6ec8589 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -508,7 +508,7 @@ export default { const fn = (value) => callback(value, key, params); if (pt?.hasOwnProperty('_usept')) { - const { merge, useMergeProps } = pt['_usept']; + const { mergeSections, mergeProps: useMergeProps } = pt['_usept']; const originalValue = fn(pt.originalValue); const value = fn(pt.value); @@ -516,7 +516,7 @@ export default { else if (ObjectUtils.isString(value)) return value; else if (ObjectUtils.isString(originalValue)) return originalValue; - return merge ? (useMergeProps ? mergeProps(originalValue, value) : { ...originalValue, ...value }) : value; + return mergeSections || (!mergeSections && value) ? (useMergeProps ? mergeProps(originalValue, value) : { ...originalValue, ...value }) : value; } return fn(pt); diff --git a/components/lib/basedirective/BaseDirective.js b/components/lib/basedirective/BaseDirective.js index 834ac4ba2..47e9b28e6 100644 --- a/components/lib/basedirective/BaseDirective.js +++ b/components/lib/basedirective/BaseDirective.js @@ -52,7 +52,7 @@ const BaseDirective = { const fn = (value) => callback(value, key, params); if (pt?.hasOwnProperty('_usept')) { - const { merge, useMergeProps } = pt['_usept']; + const { mergeSections, mergeProps: useMergeProps } = pt['_usept']; const originalValue = fn(pt.originalValue); const value = fn(pt.value); @@ -60,7 +60,7 @@ const BaseDirective = { else if (ObjectUtils.isString(value)) return value; else if (ObjectUtils.isString(originalValue)) return originalValue; - return merge ? (useMergeProps ? mergeProps(originalValue, value) : { ...originalValue, ...value }) : value; + return mergeSections || (!mergeSections && value) ? (useMergeProps ? mergeProps(originalValue, value) : { ...originalValue, ...value }) : value; } return fn(pt); diff --git a/components/lib/passthrough/index.js b/components/lib/passthrough/index.js index d8c913f77..9f4c04900 100644 --- a/components/lib/passthrough/index.js +++ b/components/lib/passthrough/index.js @@ -2,16 +2,16 @@ * @todo: Add dynamic params support; * * Exp; - * usePassThrough(pt1, pt2, pt3, pt*, { merge: true }); - * usePassThrough(pt1, { merge: true }); + * usePassThrough(pt1, pt2, pt3, pt*, { mergeSections: true }); + * usePassThrough(pt1, { mergeSections: true }); */ -export const usePassThrough = (pt1 = {}, pt2 = {}, { merge = true, useMergeProps = true } = {}) => { +export const usePassThrough = (pt1 = {}, pt2 = {}, { mergeSections = true, mergeProps = false } = {}) => { return { _usept: { - merge, - useMergeProps + mergeSections, + mergeProps }, originalValue: pt1, - value: pt2 + value: { ...pt1, ...pt2 } }; };