gyyg-components 0.1.16 → 0.2.0

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": "gyyg-components",
3
- "version": "0.1.16",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -98,10 +98,9 @@
98
98
  </div>
99
99
  </template>
100
100
  <script>
101
- import { deepCopy } from "@/utils/common.js";
102
- import styleText from './styleText.vue'
103
- import btnClick from './btnClick.vue'
104
- import iconButton from './iconButton.vue';
101
+ import styleText from '@/otherComponents/styleText.vue'
102
+ import btnClick from '@/otherComponents/btnClick.vue'
103
+ import iconButton from '@/otherComponents/iconButton.vue';
105
104
  export default {
106
105
  name: 'EmcTable',
107
106
  components: {
@@ -225,9 +224,8 @@ export default {
225
224
  watch: {
226
225
  columns: {
227
226
  handler: function (val) {
228
- console.log(this.selection);
229
227
 
230
- this.column = deepCopy(val);
228
+ this.column = val;
231
229
  },
232
230
  immediate: true,
233
231
  deep: true,
package/src/index.js CHANGED
@@ -7,7 +7,6 @@ const components = modulesFiles.keys().reduce((components, modulePath) => {
7
7
  const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, "$1");
8
8
  const value = modulesFiles(modulePath);
9
9
  components[moduleName] = value.default;
10
-
11
10
  return components;
12
11
  }, {});
13
12
 
@@ -18,7 +17,6 @@ const install = function (Vue) {
18
17
  if (install.installed) return;
19
18
  // 遍历注册全局组件
20
19
  Object.values(components).forEach((component) => {
21
-
22
20
  // 如果组件提供了 install 方法,则使用 install 方法注册
23
21
  if (typeof component.install === "function") {
24
22
  Vue.use(component);
@@ -29,14 +27,12 @@ const install = function (Vue) {
29
27
  requireDirective.keys().forEach((directiveFileName) => {
30
28
  const moduleName = directiveFileName.replace(/^\.\/(.*)\.\w+$/, "$1");
31
29
  const directiveConfig = requireDirective(directiveFileName);
32
- console.log(moduleName)
33
30
  Vue.directive(moduleName, directiveConfig.default);
34
31
  });
35
32
  };
36
33
 
37
34
  // 判断是否是直接引入文件
38
35
  if (typeof window !== "undefined" && window.Vue) {
39
-
40
36
  install(window.Vue);
41
37
  }
42
38
 
@@ -45,4 +41,4 @@ export default {
45
41
  install,
46
42
  // 以下是具体的组件列表
47
43
  ...components,
48
- }
44
+ };
@@ -16,66 +16,6 @@ export function isEmpty(value) {
16
16
  }
17
17
  return false;
18
18
  }
19
- // 深拷贝
20
- export function deepCopy(obj, hash = new WeakMap()) {
21
- // 处理 null、undefined 和非对象类型(如数字、字符串、布尔值等)
22
- if (obj === null || typeof obj !== 'object') {
23
- return obj;
24
- }
25
-
26
- // 处理循环引用
27
- if (hash.has(obj)) {
28
- return hash.get(obj);
29
- }
30
-
31
- // 处理 Date 对象
32
- if (obj instanceof Date) {
33
- return new Date(obj);
34
- }
35
-
36
- // 处理 Array 对象
37
- if (Array.isArray(obj)) {
38
- const copy = [];
39
- hash.set(obj, copy);
40
- for (let i = 0; i < obj.length; i++) {
41
- copy[i] = deepCopy(obj[i], hash);
42
- }
43
- return copy;
44
- }
45
-
46
- // 处理普通对象
47
- const copy = {};
48
- hash.set(obj, copy);
49
- for (const key in obj) {
50
- if (obj.hasOwnProperty(key)) {
51
- copy[key] = deepCopy(obj[key], hash);
52
- }
53
- }
54
-
55
- // 处理 Map 和 Set 对象(可选)
56
- if (obj instanceof Map) {
57
- const copy = new Map();
58
- hash.set(obj, copy);
59
- obj.forEach((value, key) => {
60
- copy.set(deepCopy(key, hash), deepCopy(value, hash));
61
- });
62
- return copy;
63
- }
64
-
65
- if (obj instanceof Set) {
66
- const copy = new Set();
67
- hash.set(obj, copy);
68
- obj.forEach(value => {
69
- copy.add(deepCopy(value, hash));
70
- });
71
- return copy;
72
- }
73
-
74
- // 处理其他类型的对象(如自定义对象、TypedArray 等)可能需要额外的逻辑
75
- // 这里默认返回空对象或基本类型的值(如果上述条件都不满足)
76
- return copy;
77
- }
78
-
79
19
  /**
80
20
  * @param {string} path
81
21
  * @returns {Boolean}