vue-happy-framework 1.0.11 → 1.0.12
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/README.md +1 -4
- package/common/utils/ApiBase.js +1 -0
- package/common/utils/EventBus.js +21 -0
- package/common/utils/animation.js +42 -0
- package/common/utils/file.js +21 -0
- package/common/utils/function.js +72 -0
- package/common/utils/img.js +26 -0
- package/common/utils/index.js +10 -0
- package/common/utils/request.js +1 -0
- package/common/utils/stringUtils.js +14 -0
- package/common/utils/table.js +10 -0
- package/common/utils/tree.js +75 -0
- package/common/utils.js +10 -0
- package/index.css +1 -1
- package/package.json +38 -47
- package/pc/components/HelloWorld.js +45 -0
- package/pc/components/NewButton.js +46 -0
- package/pc/components/index.js +4 -61
- package/pc/directives/copy.js +46 -0
- package/pc/utils/ApiBase.js +1 -0
- package/pc/utils/EventBus.js +21 -0
- package/pc/utils/animation.js +42 -0
- package/pc/utils/file.js +21 -0
- package/pc/utils/function.js +72 -0
- package/pc/utils/img.js +26 -0
- package/pc/utils/index.js +8 -3030
- package/pc/utils/request.js +34 -0
- package/pc/utils/stringUtils.js +14 -0
- package/pc/utils/table.js +10 -0
- package/pc/utils/tree.js +75 -0
- package/_plugin-vue_export-helper-BHFhmbuH.cjs +0 -1
- package/index2.css +0 -1
- package/mobile/components/index.cjs +0 -1
- package/mobile/components/index.d.ts +0 -3
- package/mobile/components/index.js +0 -53
- package/mobile/utils/index.d.ts +0 -2
- package/pc/components/index.cjs +0 -1
- package/pc/components/index.d.ts +0 -3
- package/pc/utils/index.cjs +0 -11
- package/pc/utils/index.d.ts +0 -2
- package/styles/style.scss +0 -12
- package/utils/index.cjs +0 -1
- package/utils/index.d.ts +0 -7
- package/utils/index.js +0 -193
package/README.md
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
# 基于Vue3的前端框架库
|
|
2
2
|
|
|
3
3
|
## 目录结构
|
|
4
|
+
- common(公共的)
|
|
4
5
|
- pc(面向PC端的工具库跟组件)
|
|
5
6
|
- mobile(面向移动端的工具库跟组件)
|
|
6
|
-
- styles(公共的scss样式)
|
|
7
|
-
- utils(公共库)
|
|
8
|
-
- index.css(面向PC端的组件样式)
|
|
9
|
-
- indexx2.css(面向移动端的组件样式)
|
|
10
7
|
|
|
11
8
|
## 亮点
|
|
12
9
|
源码采用typescript编写,最终转译成JavaScript,将公共库、PC端公用组件、移动端公用组件抽象出来整合在一起
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class o {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.bus = {};
|
|
4
|
+
}
|
|
5
|
+
$on(s, t) {
|
|
6
|
+
if (this.bus.hasOwnProperty(s)) {
|
|
7
|
+
console.log("该事件名已订阅过");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
this.bus[s] = t;
|
|
11
|
+
}
|
|
12
|
+
$emit(s, t) {
|
|
13
|
+
this.bus[s].apply(null, [t]);
|
|
14
|
+
}
|
|
15
|
+
$off(s) {
|
|
16
|
+
delete this.bus[s];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
o as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function f(u, i, n) {
|
|
2
|
+
var e = document.getElementById(u), o = e.getAttribute(i), a = o - 1e3, r = function() {
|
|
3
|
+
a < o && (a++, e.innerText = a), setTimeout(r, n);
|
|
4
|
+
};
|
|
5
|
+
setTimeout(r, n);
|
|
6
|
+
}
|
|
7
|
+
function v(u, i) {
|
|
8
|
+
var n = document.getElementsByClassName(u)[0], e = n.firstElementChild, o = e.children.length;
|
|
9
|
+
let a = e == null ? void 0 : e.children;
|
|
10
|
+
const r = document.createDocumentFragment();
|
|
11
|
+
for (var d = 0; d < o; d++) {
|
|
12
|
+
let m = a[d].cloneNode(!0);
|
|
13
|
+
r.appendChild(m);
|
|
14
|
+
}
|
|
15
|
+
e.appendChild(r);
|
|
16
|
+
let s = 0;
|
|
17
|
+
o >= 2 && (s = e == null ? void 0 : e.children[1].offsetTop);
|
|
18
|
+
var t = 0;
|
|
19
|
+
function l() {
|
|
20
|
+
t >= o && (t = 0, e.style.top = "0px"), t++, e.children[t - 1].classList.add("active"), e.animate([
|
|
21
|
+
{ top: -((t - 1) * s) + "px" },
|
|
22
|
+
{ top: -(t * s) + "px" }
|
|
23
|
+
], {
|
|
24
|
+
duration: 1e3,
|
|
25
|
+
delay: 100,
|
|
26
|
+
easing: "ease-in",
|
|
27
|
+
fill: "forwards"
|
|
28
|
+
}), setTimeout(function() {
|
|
29
|
+
e.children[t - 1].classList.remove("active");
|
|
30
|
+
}, 1e3), c = setTimeout(l, i);
|
|
31
|
+
}
|
|
32
|
+
var c = setTimeout(l, i);
|
|
33
|
+
n.onmouseover = function() {
|
|
34
|
+
clearTimeout(c);
|
|
35
|
+
}, n.onmouseout = function() {
|
|
36
|
+
c = setTimeout(l, i);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
v as AutoScroll,
|
|
41
|
+
f as NunberAdd
|
|
42
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function l(e) {
|
|
2
|
+
return `undefined${e}`;
|
|
3
|
+
}
|
|
4
|
+
function o(e) {
|
|
5
|
+
let t = {};
|
|
6
|
+
return typeof e == "string" ? t = JSON.parse(e || "{}") : t = e, t.url = l(t.path), t;
|
|
7
|
+
}
|
|
8
|
+
function i(e) {
|
|
9
|
+
let t;
|
|
10
|
+
return Array.isArray(e) ? t = e : t = JSON.parse(e || "[]"), t.map((n) => (n.url = l(n.path), n));
|
|
11
|
+
}
|
|
12
|
+
function c(e, t) {
|
|
13
|
+
let n = new Blob([e]), r = document.createElement("a");
|
|
14
|
+
r.download = "导出文件.xlsx", r.href = URL.createObjectURL(n), r.style.display = "none", r.target = "_blank", document.appendChild(r), r.click(), URL.revokeObjectURL(n), document.body.removeChild(r);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
c as exportExl,
|
|
18
|
+
l as getFileUrl,
|
|
19
|
+
o as getShowFile,
|
|
20
|
+
i as getShowFileList
|
|
21
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function o(n, r = /* @__PURE__ */ new WeakMap()) {
|
|
2
|
+
if (typeof n != "object" || n === null)
|
|
3
|
+
return n;
|
|
4
|
+
if (r.has(n))
|
|
5
|
+
return r.get(n);
|
|
6
|
+
let e;
|
|
7
|
+
return n instanceof Array ? (e = [], r.set(n, e), n.forEach((u, t) => {
|
|
8
|
+
e[t] = o(u, r);
|
|
9
|
+
}), e) : n instanceof Date ? (e = new Date(n), r.set(n, e), e) : n instanceof RegExp ? (e = new RegExp(n.source, n.flags), r.set(n, e), e) : typeof n == "object" ? (e = {}, r.set(n, e), Reflect.ownKeys(n).forEach((t) => {
|
|
10
|
+
e[t] = o(n[t], r);
|
|
11
|
+
}), e) : n;
|
|
12
|
+
}
|
|
13
|
+
function s(n, r) {
|
|
14
|
+
var e = null;
|
|
15
|
+
return function() {
|
|
16
|
+
clearTimeout(e), e = setTimeout(() => {
|
|
17
|
+
n.apply(this, arguments);
|
|
18
|
+
}, r);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function f(n, r) {
|
|
22
|
+
var e = !0;
|
|
23
|
+
return function() {
|
|
24
|
+
e && (e = !1, setTimeout(() => {
|
|
25
|
+
n.apply(this, arguments), e = !0;
|
|
26
|
+
}, r));
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function l(n, ...r) {
|
|
30
|
+
const e = n.length;
|
|
31
|
+
return function(...u) {
|
|
32
|
+
let t = [...r, ...u];
|
|
33
|
+
return t.length < e ? l.call(this, n, ...t) : n.apply(this, t);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function c(n) {
|
|
37
|
+
var r = Array.prototype.slice.call(arguments, 1);
|
|
38
|
+
return function() {
|
|
39
|
+
var e = Array.prototype.slice.call(arguments), u = r.concat(e);
|
|
40
|
+
return n.apply(null, u);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function p(n, r, e, u) {
|
|
44
|
+
return n.addEventListener(r, (t) => {
|
|
45
|
+
let i = t.target;
|
|
46
|
+
for (; !i.matches(e); ) {
|
|
47
|
+
if (n === i) {
|
|
48
|
+
i = null;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
i = i.parentNode;
|
|
52
|
+
}
|
|
53
|
+
i && u.call(i, t, i);
|
|
54
|
+
}), n;
|
|
55
|
+
}
|
|
56
|
+
function a(n) {
|
|
57
|
+
if (!(n instanceof Function) || !n.prototype)
|
|
58
|
+
throw new Error("不是合法的构造函数");
|
|
59
|
+
let r;
|
|
60
|
+
return function() {
|
|
61
|
+
return r || (r = new n()), r;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
a as SingleWrapper,
|
|
66
|
+
c as curry,
|
|
67
|
+
l as currying,
|
|
68
|
+
s as debounce,
|
|
69
|
+
o as deepClone,
|
|
70
|
+
p as delegate,
|
|
71
|
+
f as throttle
|
|
72
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function i(t) {
|
|
2
|
+
return new Promise((a) => {
|
|
3
|
+
var e = new Image();
|
|
4
|
+
e.crossOrigin = "anonymous", e.src = t, e.onload = function() {
|
|
5
|
+
var n = document.createElement("canvas");
|
|
6
|
+
n.width = e.width, n.height = e.height, n.getContext("2d").drawImage(e, 0, 0);
|
|
7
|
+
var o = n.toDataURL();
|
|
8
|
+
a(o);
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function r(t) {
|
|
13
|
+
return new Promise((a) => {
|
|
14
|
+
var e = new Image();
|
|
15
|
+
e.crossOrigin = "anonymous", e.src = t, e.onload = function() {
|
|
16
|
+
var n = document.createElement("canvas");
|
|
17
|
+
n.width = e.width, n.height = e.height, n.getContext("2d").drawImage(e, 0, 0), n.toBlob((o) => {
|
|
18
|
+
a(o);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
i as imgToBase64,
|
|
25
|
+
r as imgToBlob
|
|
26
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AutoScroll as r, NunberAdd as t } from "./animation.js";
|
|
2
|
+
import { exportExl as i, getFileUrl as x, getShowFile as g, getShowFileList as p } from "./file.js";
|
|
3
|
+
export {
|
|
4
|
+
r as AutoScroll,
|
|
5
|
+
t as NunberAdd,
|
|
6
|
+
i as exportExl,
|
|
7
|
+
x as getFileUrl,
|
|
8
|
+
g as getShowFile,
|
|
9
|
+
p as getShowFileList
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function t(r, { char: n = "_" } = {}) {
|
|
2
|
+
return r.replace(new RegExp(`${n}([a-z])`, "g"), (e, a) => a.toUpperCase());
|
|
3
|
+
}
|
|
4
|
+
function p(r, { char: n = "_" } = {}) {
|
|
5
|
+
return r.replace(new RegExp(`${n}([a-z])`, "g"), function(e) {
|
|
6
|
+
return e[1].toUpperCase();
|
|
7
|
+
}).replace(/^([a-z])/, function(e) {
|
|
8
|
+
return e.toUpperCase();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
t as convertCamelCase,
|
|
13
|
+
p as convertPascalCase
|
|
14
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function h(f, r) {
|
|
2
|
+
let e = JSON.parse(JSON.stringify(f)), t = "id", i = "pid";
|
|
3
|
+
r && (t = r.id, i = r.pid);
|
|
4
|
+
let o = /* @__PURE__ */ new Map();
|
|
5
|
+
for (let n of e)
|
|
6
|
+
o.set(n[t], n);
|
|
7
|
+
let d = [];
|
|
8
|
+
for (let n of e)
|
|
9
|
+
if (o.has(n[i])) {
|
|
10
|
+
let l = o.get(n[i]);
|
|
11
|
+
l.children == null && (l.children = []), l.children.push(n);
|
|
12
|
+
} else
|
|
13
|
+
d.push(n);
|
|
14
|
+
return d;
|
|
15
|
+
}
|
|
16
|
+
function s(f = [], r = [], e = []) {
|
|
17
|
+
if (!f.length) return [];
|
|
18
|
+
for (let t of f) {
|
|
19
|
+
if (!(r.includes(items.parentCode) || r.includes(t.organCode))) continue;
|
|
20
|
+
let i = {
|
|
21
|
+
...t,
|
|
22
|
+
children: []
|
|
23
|
+
};
|
|
24
|
+
e.push(i), t.children && t.children.length && s(t.children, r, i.children);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function a(f, r, e) {
|
|
28
|
+
e == null && (e = "children");
|
|
29
|
+
for (let t of f) {
|
|
30
|
+
if (r(t))
|
|
31
|
+
return t;
|
|
32
|
+
if (t[e]) {
|
|
33
|
+
let i = a(t[e], r);
|
|
34
|
+
if (i)
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function p(f, r, e) {
|
|
40
|
+
e == null && (e = "children");
|
|
41
|
+
for (let t of f) {
|
|
42
|
+
for (let i in r)
|
|
43
|
+
t[i] = r[i];
|
|
44
|
+
t[e] && p(t[e], r, e);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function c(f, r) {
|
|
48
|
+
var e = [];
|
|
49
|
+
let t = "children";
|
|
50
|
+
return r && (t = r.children), u(f, e, t), e;
|
|
51
|
+
}
|
|
52
|
+
function u(f, r, e) {
|
|
53
|
+
if (!(!f || !f.length))
|
|
54
|
+
for (let t of f) {
|
|
55
|
+
let i = JSON.parse(JSON.stringify(t));
|
|
56
|
+
t[e] && delete i[e], r.push(i), t[e] && u(t[e], r, e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function T(f, r, e) {
|
|
60
|
+
let t = c(f, e);
|
|
61
|
+
for (let i of t) {
|
|
62
|
+
itemMap[i.id] = i;
|
|
63
|
+
let o = itemMap[i.parentId];
|
|
64
|
+
o && (i.parent = {}, i.parent = o), i.code == r && (data = itemMap[i.id]);
|
|
65
|
+
}
|
|
66
|
+
return data;
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
p as addDataTree,
|
|
70
|
+
s as filterTree,
|
|
71
|
+
a as findTreeNode,
|
|
72
|
+
T as getParentData,
|
|
73
|
+
h as listToTree,
|
|
74
|
+
c as treeToList
|
|
75
|
+
};
|
package/common/utils.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AutoScroll as r, NunberAdd as t } from "./utils/animation.js";
|
|
2
|
+
import { exportExl as i, getFileUrl as x, getShowFile as g, getShowFileList as p } from "./utils/file.js";
|
|
3
|
+
export {
|
|
4
|
+
r as AutoScroll,
|
|
5
|
+
t as NunberAdd,
|
|
6
|
+
i as exportExl,
|
|
7
|
+
x as getFileUrl,
|
|
8
|
+
g as getShowFile,
|
|
9
|
+
p as getShowFileList
|
|
10
|
+
};
|
package/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.read-the-docs[data-v-47a910e0]{color:#888}.new-button[data-v-0b2bc4af]{color:red}
|
package/package.json
CHANGED
|
@@ -1,48 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue-happy-framework",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "基于Vue的应用框架",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"vue",
|
|
7
|
-
"framework",
|
|
8
|
-
"工具库"
|
|
9
|
-
],
|
|
10
|
-
"type": "module",
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"@rollup/plugin-typescript": "^12.1.2",
|
|
40
|
-
"@vitejs/plugin-vue": "^5.2.1",
|
|
41
|
-
"sass": "^1.79.1",
|
|
42
|
-
"typescript": "^5.5.3",
|
|
43
|
-
"vite": "^6.0.1",
|
|
44
|
-
"vite-plugin-cp": "^4.0.8",
|
|
45
|
-
"vite-plugin-dts": "^4.4.0",
|
|
46
|
-
"vue-tsc": "^2.0.29"
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-happy-framework",
|
|
3
|
+
"version": "1.0.12",
|
|
4
|
+
"description": "基于Vue的应用框架",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vue",
|
|
7
|
+
"framework",
|
|
8
|
+
"工具库"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "index.js",
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"packageManager": "pnpm@10.22.0",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@wangeditor/editor": "^5.1.23",
|
|
17
|
+
"animate.css": "^4.1.1",
|
|
18
|
+
"axios": "^1.13.2",
|
|
19
|
+
"clipboard": "^2.0.11",
|
|
20
|
+
"dayjs": "^1.11.19",
|
|
21
|
+
"echarts": "^6.0.0",
|
|
22
|
+
"enum-plus": "^3.1.6",
|
|
23
|
+
"normalize.css": "^8.0.1",
|
|
24
|
+
"pinia": "^3.0.4",
|
|
25
|
+
"vue": "^3.5.26",
|
|
26
|
+
"vue-router": "^4.6.4"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
30
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
31
|
+
"glob": "^13.0.0",
|
|
32
|
+
"sass": "^1.97.1",
|
|
33
|
+
"typescript": "^5.9.3",
|
|
34
|
+
"vite": "^6.0.1",
|
|
35
|
+
"vite-plugin-cp": "^6.0.3",
|
|
36
|
+
"vite-plugin-dts": "^4.4.0",
|
|
37
|
+
"vue-tsc": "^3.2.1"
|
|
38
|
+
}
|
|
48
39
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent as s, ref as a, createElementBlock as u, openBlock as i, Fragment as p, createElementVNode as e, toDisplayString as n, createTextVNode as o } from "D:/GitReponsitory/vue-happy-framework/node_modules/.pnpm/vue@3.5.26_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js";
|
|
2
|
+
import { _ as d } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const m = { class: "card" }, f = /* @__PURE__ */ s({
|
|
4
|
+
__name: "HelloWorld",
|
|
5
|
+
props: {
|
|
6
|
+
msg: {}
|
|
7
|
+
},
|
|
8
|
+
setup(r) {
|
|
9
|
+
const l = a(0);
|
|
10
|
+
return (g, t) => (i(), u(p, null, [
|
|
11
|
+
e("h1", null, n(r.msg), 1),
|
|
12
|
+
e("div", m, [
|
|
13
|
+
e("button", {
|
|
14
|
+
type: "button",
|
|
15
|
+
onClick: t[0] || (t[0] = (c) => l.value++)
|
|
16
|
+
}, "count is " + n(l.value), 1),
|
|
17
|
+
t[1] || (t[1] = e("p", null, [
|
|
18
|
+
o(" Edit "),
|
|
19
|
+
e("code", null, "components/HelloWorld.vue"),
|
|
20
|
+
o(" to test HMR ")
|
|
21
|
+
], -1))
|
|
22
|
+
]),
|
|
23
|
+
t[2] || (t[2] = e("p", null, [
|
|
24
|
+
o(" Check out "),
|
|
25
|
+
e("a", {
|
|
26
|
+
href: "https://vuejs.org/guide/quick-start.html#local",
|
|
27
|
+
target: "_blank"
|
|
28
|
+
}, "create-vue"),
|
|
29
|
+
o(", the official Vue + Vite starter ")
|
|
30
|
+
], -1)),
|
|
31
|
+
t[3] || (t[3] = e("p", null, [
|
|
32
|
+
o(" Install "),
|
|
33
|
+
e("a", {
|
|
34
|
+
href: "https://github.com/vuejs/language-tools",
|
|
35
|
+
target: "_blank"
|
|
36
|
+
}, "Volar"),
|
|
37
|
+
o(" in your IDE for a better DX ")
|
|
38
|
+
], -1)),
|
|
39
|
+
t[4] || (t[4] = e("p", { class: "read-the-docs" }, "Click on the Vite and Vue logos to learn more", -1))
|
|
40
|
+
], 64));
|
|
41
|
+
}
|
|
42
|
+
}), V = /* @__PURE__ */ d(f, [["__scopeId", "data-v-47a910e0"]]);
|
|
43
|
+
export {
|
|
44
|
+
V as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as f, mergeModels as u, useAttrs as V, useModel as _, toRefs as g, resolveComponent as x, createElementBlock as N, openBlock as b, withDirectives as h, createElementVNode as s, createVNode as w, vModelText as B, unref as C, mergeProps as M, withCtx as $, renderSlot as o, createTextVNode as y, toDisplayString as S } from "D:/GitReponsitory/vue-happy-framework/node_modules/.pnpm/vue@3.5.26_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js";
|
|
2
|
+
import { _ as k } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const A = ["value"], D = /* @__PURE__ */ f({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "NewButton",
|
|
6
|
+
props: /* @__PURE__ */ u({
|
|
7
|
+
value: String
|
|
8
|
+
}, {
|
|
9
|
+
modelValue: {},
|
|
10
|
+
modelModifiers: {}
|
|
11
|
+
}),
|
|
12
|
+
emits: /* @__PURE__ */ u(["update:value"], ["update:modelValue"]),
|
|
13
|
+
setup(l, { emit: a }) {
|
|
14
|
+
const r = V();
|
|
15
|
+
console.log("attrs", r);
|
|
16
|
+
const t = _(l, "modelValue"), d = l, { value: i } = g(d), p = a, m = (e) => {
|
|
17
|
+
p("update:value", e.target.value);
|
|
18
|
+
};
|
|
19
|
+
return (e, n) => {
|
|
20
|
+
const c = x("el-button");
|
|
21
|
+
return b(), N("div", null, [
|
|
22
|
+
h(s("input", {
|
|
23
|
+
"onUpdate:modelValue": n[0] || (n[0] = (v) => t.value = v)
|
|
24
|
+
}, null, 512), [
|
|
25
|
+
[B, t.value]
|
|
26
|
+
]),
|
|
27
|
+
s("input", {
|
|
28
|
+
value: C(i),
|
|
29
|
+
onInput: m
|
|
30
|
+
}, null, 40, A),
|
|
31
|
+
w(c, M({ type: "primary" }, e.$attrs), {
|
|
32
|
+
default: $(() => [
|
|
33
|
+
o(e.$slots, "prefix", { text: "前缀文本" }, void 0, !0),
|
|
34
|
+
y(" modelValue的值" + S(t.value) + " ", 1),
|
|
35
|
+
o(e.$slots, "default", {}, void 0, !0),
|
|
36
|
+
o(e.$slots, "suffix", {}, void 0, !0)
|
|
37
|
+
]),
|
|
38
|
+
_: 3
|
|
39
|
+
}, 16)
|
|
40
|
+
]);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}), T = /* @__PURE__ */ k(D, [["__scopeId", "data-v-0b2bc4af"]]);
|
|
44
|
+
export {
|
|
45
|
+
T as default
|
|
46
|
+
};
|
package/pc/components/index.js
CHANGED
|
@@ -1,63 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const x = { class: "button-container" }, k = /* @__PURE__ */ a({
|
|
4
|
-
__name: "index",
|
|
5
|
-
emits: ["click"],
|
|
6
|
-
setup(u, { emit: t }) {
|
|
7
|
-
const n = t, o = () => {
|
|
8
|
-
n("click");
|
|
9
|
-
};
|
|
10
|
-
return (f, e) => {
|
|
11
|
-
const c = s("el-button");
|
|
12
|
-
return l(), r("div", null, [
|
|
13
|
-
d("div", x, [
|
|
14
|
-
_(c, {
|
|
15
|
-
type: "primary",
|
|
16
|
-
onClick: o
|
|
17
|
-
}, {
|
|
18
|
-
default: i(() => e[0] || (e[0] = [
|
|
19
|
-
m("测试按钮")
|
|
20
|
-
])),
|
|
21
|
-
_: 1
|
|
22
|
-
})
|
|
23
|
-
])
|
|
24
|
-
]);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}), y = /* @__PURE__ */ p(k, [["__scopeId", "data-v-e1bf4c52"]]), v = { class: "badge-container" }, C = /* @__PURE__ */ a({
|
|
28
|
-
__name: "index",
|
|
29
|
-
emits: ["click"],
|
|
30
|
-
setup(u, { emit: t }) {
|
|
31
|
-
const n = t, o = () => {
|
|
32
|
-
n("click");
|
|
33
|
-
};
|
|
34
|
-
return (f, e) => {
|
|
35
|
-
const c = s("el-button"), b = s("el-badge");
|
|
36
|
-
return l(), r("div", null, [
|
|
37
|
-
d("div", v, [
|
|
38
|
-
_(b, {
|
|
39
|
-
value: 12,
|
|
40
|
-
class: "item"
|
|
41
|
-
}, {
|
|
42
|
-
default: i(() => [
|
|
43
|
-
_(c, {
|
|
44
|
-
type: "primary",
|
|
45
|
-
onClick: o
|
|
46
|
-
}, {
|
|
47
|
-
default: i(() => e[0] || (e[0] = [
|
|
48
|
-
m("测试按钮")
|
|
49
|
-
])),
|
|
50
|
-
_: 1
|
|
51
|
-
})
|
|
52
|
-
]),
|
|
53
|
-
_: 1
|
|
54
|
-
})
|
|
55
|
-
])
|
|
56
|
-
]);
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}), B = /* @__PURE__ */ p(C, [["__scopeId", "data-v-72e844b2"]]);
|
|
1
|
+
import { default as t } from "./HelloWorld.js";
|
|
2
|
+
import { default as r } from "./NewButton.js";
|
|
60
3
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
4
|
+
t as HelloWorld,
|
|
5
|
+
r as NewButton
|
|
63
6
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import t from "D:/GitReponsitory/vue-happy-framework/node_modules/.pnpm/clipboard@2.0.11/node_modules/clipboard/dist/clipboard.js";
|
|
2
|
+
import { ElMessage as i } from "D:/GitReponsitory/vue-happy-framework/node_modules/.pnpm/element-plus@2.13.0_vue@3.5.26_typescript@5.9.3_/node_modules/element-plus/es/index.mjs";
|
|
3
|
+
function u() {
|
|
4
|
+
return {
|
|
5
|
+
created(e, n, o, d) {
|
|
6
|
+
e.style.color = "#E6A23C";
|
|
7
|
+
let r;
|
|
8
|
+
e.onmouseenter = () => {
|
|
9
|
+
r = new t(e, {
|
|
10
|
+
text: () => n.value == null ? e.innerText : n.value
|
|
11
|
+
});
|
|
12
|
+
}, e.onclick = () => {
|
|
13
|
+
r.on("success", () => {
|
|
14
|
+
i.success({
|
|
15
|
+
message: "复制成功"
|
|
16
|
+
}), r.destroy();
|
|
17
|
+
});
|
|
18
|
+
}, e.onmouseleave = () => {
|
|
19
|
+
r.destroy();
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
// 在元素被插入到 DOM 前调用
|
|
23
|
+
beforeMount(e, n, o, d) {
|
|
24
|
+
},
|
|
25
|
+
// 在绑定元素的父组件
|
|
26
|
+
// 及他自己的所有子节点都挂载完成后调用
|
|
27
|
+
mounted(e, n, o, d) {
|
|
28
|
+
},
|
|
29
|
+
// 绑定元素的父组件更新前调用
|
|
30
|
+
beforeUpdate(e, n, o, d) {
|
|
31
|
+
},
|
|
32
|
+
// 在绑定元素的父组件
|
|
33
|
+
// 及他自己的所有子节点都更新后调用
|
|
34
|
+
updated(e, n, o, d) {
|
|
35
|
+
},
|
|
36
|
+
// 绑定元素的父组件卸载前调用
|
|
37
|
+
beforeUnmount(e, n, o, d) {
|
|
38
|
+
},
|
|
39
|
+
// 绑定元素的父组件卸载后调用
|
|
40
|
+
unmounted(e, n, o, d) {
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
u as default
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class o {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.bus = {};
|
|
4
|
+
}
|
|
5
|
+
$on(s, t) {
|
|
6
|
+
if (this.bus.hasOwnProperty(s)) {
|
|
7
|
+
console.log("该事件名已订阅过");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
this.bus[s] = t;
|
|
11
|
+
}
|
|
12
|
+
$emit(s, t) {
|
|
13
|
+
this.bus[s].apply(null, [t]);
|
|
14
|
+
}
|
|
15
|
+
$off(s) {
|
|
16
|
+
delete this.bus[s];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
o as default
|
|
21
|
+
};
|