gyyg-components 0.1.15 → 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.15",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -98,12 +98,11 @@
98
98
  </div>
99
99
  </template>
100
100
  <script>
101
- import deepCopy from './methods'
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
- name: 'emc-table',
105
+ name: 'EmcTable',
107
106
  components: {
108
107
  styleText,
109
108
  btnClick,
@@ -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
@@ -27,7 +27,6 @@ const install = function (Vue) {
27
27
  requireDirective.keys().forEach((directiveFileName) => {
28
28
  const moduleName = directiveFileName.replace(/^\.\/(.*)\.\w+$/, "$1");
29
29
  const directiveConfig = requireDirective(directiveFileName);
30
- console.log(moduleName)
31
30
  Vue.directive(moduleName, directiveConfig.default);
32
31
  });
33
32
  };
@@ -42,4 +41,4 @@ export default {
42
41
  install,
43
42
  // 以下是具体的组件列表
44
43
  ...components,
45
- }
44
+ };
@@ -1,59 +0,0 @@
1
- // 深拷贝
2
- export default function deepCopy(obj, hash = new WeakMap()) {
3
- // 处理 null、undefined 和非对象类型(如数字、字符串、布尔值等)
4
- if (obj === null || typeof obj !== 'object') {
5
- return obj;
6
- }
7
-
8
- // 处理循环引用
9
- if (hash.has(obj)) {
10
- return hash.get(obj);
11
- }
12
-
13
- // 处理 Date 对象
14
- if (obj instanceof Date) {
15
- return new Date(obj);
16
- }
17
-
18
- // 处理 Array 对象
19
- if (Array.isArray(obj)) {
20
- const copy = [];
21
- hash.set(obj, copy);
22
- for (let i = 0; i < obj.length; i++) {
23
- copy[i] = deepCopy(obj[i], hash);
24
- }
25
- return copy;
26
- }
27
-
28
- // 处理普通对象
29
- const copy = {};
30
- hash.set(obj, copy);
31
- for (const key in obj) {
32
- if (obj.hasOwnProperty(key)) {
33
- copy[key] = deepCopy(obj[key], hash);
34
- }
35
- }
36
-
37
- // 处理 Map 和 Set 对象(可选)
38
- if (obj instanceof Map) {
39
- const copy = new Map();
40
- hash.set(obj, copy);
41
- obj.forEach((value, key) => {
42
- copy.set(deepCopy(key, hash), deepCopy(value, hash));
43
- });
44
- return copy;
45
- }
46
-
47
- if (obj instanceof Set) {
48
- const copy = new Set();
49
- hash.set(obj, copy);
50
- obj.forEach(value => {
51
- copy.add(deepCopy(value, hash));
52
- });
53
- return copy;
54
- }
55
-
56
- // 处理其他类型的对象(如自定义对象、TypedArray 等)可能需要额外的逻辑
57
- // 这里默认返回空对象或基本类型的值(如果上述条件都不满足)
58
- return copy;
59
- }