gyyg-components 0.1.16 → 0.2.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/lib/demo.html +0 -2
- package/lib/gyyg-components.common.js +1496 -6361
- package/lib/gyyg-components.umd.js +1497 -6362
- package/lib/gyyg-components.umd.min.js +2481 -2
- package/package.json +1 -1
- package/src/components/MecTable/MecTable.js +5 -0
- package/src/components/{EmcTable/EmcTable.vue → MecTable/MecTable.vue} +5 -7
- package/src/index.js +1 -5
- package/src/utils/common.js +0 -60
- package/lib/gyyg-components.common.js.map +0 -1
- package/lib/gyyg-components.css +0 -1
- package/lib/gyyg-components.umd.js.map +0 -1
- package/lib/gyyg-components.umd.min.js.map +0 -1
- package/src/components/EmcTable/EmcTable.js +0 -5
- /package/src/{components/EmcTable → otherComponents}/btnClick.vue +0 -0
- /package/src/{components/EmcTable → otherComponents}/iconButton.vue +0 -0
- /package/src/{components/EmcTable → otherComponents}/styleText.vue +0 -0
package/package.json
CHANGED
|
@@ -98,12 +98,11 @@
|
|
|
98
98
|
</div>
|
|
99
99
|
</template>
|
|
100
100
|
<script>
|
|
101
|
-
import
|
|
102
|
-
import
|
|
103
|
-
import
|
|
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: '
|
|
105
|
+
name: 'MecTable',
|
|
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 =
|
|
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
|
+
};
|
package/src/utils/common.js
CHANGED
|
@@ -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}
|