@aspire-ui/element-component-pro 1.0.23 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspire-ui/element-component-pro",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Element UI 二次封装组件库,基于 Vue 2.7 + TypeScript + setup 语法糖,实现 VbenAdmin 风格的 Pro 组件",
5
5
  "type": "module",
6
6
  "main": "./dist/element-component-pro.umd.js",
@@ -17,7 +17,7 @@ function deepMerge(target: Record<string, unknown>, source?: Record<string, unkn
17
17
  const targetValue = target[key]
18
18
  const sourceValue = source[key]
19
19
 
20
- if (isPlainObject(sourceValue)) {
20
+ if (isPlainObject(sourceValue) || key !== 'components') {
21
21
  if (!isPlainObject(targetValue)) {
22
22
  target[key] = { ...(sourceValue as Record<string, unknown>) }
23
23
  } else {
@@ -60,11 +60,12 @@ export interface UseComponentSettingReturn {
60
60
  * 合并优先级:组件默认值 < 全局配置 < 组件 props
61
61
  */
62
62
  export function useComponentSetting(): UseComponentSettingReturn {
63
+ /** 返回浅拷贝(仅外层解包),内部保持对 reactive 存储的直接引用,保证响应式追踪 */
63
64
  const getSetting = <T extends Record<string, unknown> = Record<string, unknown>>(componentName?: string): T => {
64
65
  if (componentName === undefined) {
65
- return JSON.parse(JSON.stringify(componentSettings)) as T
66
+ return { ...componentSettings } as T
66
67
  }
67
- return JSON.parse(JSON.stringify(componentSettings[componentName] ?? {})) as T
68
+ return { ...(componentSettings[componentName] ?? {}) } as T
68
69
  }
69
70
 
70
71
  const setSetting = (componentName: string, config: Record<string, unknown>): void => {