@mayaxxp/cueui 1.0.0 → 1.0.1

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/dist/cueui.umd.js CHANGED
@@ -26660,19 +26660,27 @@ const components = [Select/* default */.A, Table/* default */.A, DynTable, ListS
26660
26660
  // DragButton
26661
26661
  ];
26662
26662
  const packages_install = function (Vue, options) {
26663
+ if (packages_install.installed) return;
26664
+ // 创建一个新的组件数组副本
26665
+ let allComponents = [...components]; // 不要直接修改原数组
26663
26666
  if (options && options.components) {
26664
- components = [...components, ...options.components];
26667
+ allComponents = [...allComponents, ...options.components]; // 使用副本进行扩展
26665
26668
  }
26666
26669
  if (options.axios) {
26667
26670
  Vue.prototype.$cuRequest = options.axios;
26668
26671
  }
26669
26672
  Vue.use(dic, options);
26670
26673
  // 循环全局注册组件
26671
- components.forEach(item => {
26672
- if (item.name) {
26673
- item.name = "Cu" + item.name;
26674
- }
26675
- Vue.component(item.name, item);
26674
+ allComponents.forEach(item => {
26675
+ // 修改组件命名逻辑,确保组件名称正确
26676
+ let componentName = item.name;
26677
+ if (componentName && !componentName.startsWith('Cu')) {
26678
+ componentName = "Cu" + componentName;
26679
+ } else if (!componentName) {
26680
+ // 如果组件没有定义name属性,从组件导出获取
26681
+ componentName = item.__file ? 'Cu' + item.__file.split('/').pop().replace('.vue', '') : 'CuComponent';
26682
+ }
26683
+ Vue.component(componentName, item);
26676
26684
  });
26677
26685
  };
26678
26686