kouxiangtang 0.0.11 → 0.0.13

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,7 +1,7 @@
1
1
  {
2
2
  "name": "kouxiangtang",
3
3
  "private": false,
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "type": "module",
6
6
  "main": "./dist/kouxiangtang.umd.cjs",
7
7
  "module": "./dist/kouxiangtang.js",
@@ -29,17 +29,17 @@
29
29
  "pluralize": "^8.0.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@vueup/vue-quill": "^1.2.0",
33
32
  "element-plus": "^2.7.2",
34
- "json-editor-vue": "^0.15.0",
33
+ "@vueup/vue-quill": "^1.2.0",
35
34
  "pinia": "^2.1.7",
36
- "quill-image-uploader": "^1.3.0",
37
35
  "vue": "^3.4.25",
38
- "vue-router": "^4.3.2"
36
+ "vue-router": "^4.3.2",
37
+ "json-editor-vue": "^0.15.0"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@vitejs/plugin-vue": "^5.0.4",
42
- "unplugin-element-plus": "^0.8.0",
41
+ "unplugin-auto-import": "^0.17.5",
42
+ "unplugin-vue-components": "^0.26.0",
43
43
  "vite": "^5.2.10"
44
44
  }
45
45
  }
@@ -1,98 +0,0 @@
1
- import { resolveComponent as m, openBlock as t, createBlock as l, unref as c, withCtx as a, renderSlot as y, createElementVNode as x, createVNode as n, withModifiers as B, createCommentVNode as C } from "vue";
2
- import { _ as I, b as M, l as b, p as S, d as E, a as L } from "./index-z9s-vTIc.js";
3
- import { ElMessage as p, ElLoading as u } from "element-plus";
4
- const N = { class: "image-slot" }, V = {
5
- __name: "ImageUploader",
6
- props: {
7
- imageUrl: { type: String }
8
- },
9
- emits: ["on-success"],
10
- setup(_, { emit: h }) {
11
- const g = h, r = _, f = M().imageUploadUrl;
12
- `${localStorage.getItem("token")}`;
13
- const U = (e) => {
14
- if (!(e.size / 1024 / 1024 < 5))
15
- return p({
16
- message: "上传大小不能超过 5MB!",
17
- type: "warning"
18
- }), !1;
19
- }, k = (e) => {
20
- g("on-success", e.data.imageUrl);
21
- };
22
- function w() {
23
- console.log("删除"), g("on-success", "");
24
- }
25
- function v(e) {
26
- return u.service({ text: "上传中,请稍后", background: "rgba(0,0,0,0.3)" }), new Promise((i, o) => {
27
- const s = new FormData();
28
- s.append("image", e.file), L.post(f, s, {}).then((d) => {
29
- u.service().close(), p({
30
- message: "上传成功",
31
- type: "success"
32
- }), i(d.data);
33
- }).catch(() => {
34
- u.service().close(), p({
35
- message: "上传失败",
36
- type: "warning"
37
- }), o("Upload failed");
38
- });
39
- });
40
- }
41
- return (e, i) => {
42
- const o = m("el-icon"), s = m("el-image"), d = m("el-upload");
43
- return t(), l(d, {
44
- class: "image-uploader",
45
- action: c(f),
46
- name: "image",
47
- "show-file-list": !1,
48
- "on-success": k,
49
- "before-upload": U,
50
- "http-request": v
51
- }, {
52
- default: a(() => [
53
- y(e.$slots, "default", {}, void 0, !0),
54
- r.imageUrl ? (t(), l(s, {
55
- key: 0,
56
- class: "image",
57
- src: r.imageUrl,
58
- fit: "scale-down"
59
- }, {
60
- placeholder: a(() => [
61
- x("div", N, [
62
- n(o, { class: "placeholder-icon" }, {
63
- default: a(() => [
64
- n(c(b))
65
- ]),
66
- _: 1
67
- })
68
- ])
69
- ]),
70
- _: 1
71
- }, 8, ["src"])) : (t(), l(o, {
72
- key: 1,
73
- class: "uploader-icon"
74
- }, {
75
- default: a(() => [
76
- n(c(S))
77
- ]),
78
- _: 1
79
- })),
80
- r.imageUrl ? (t(), l(o, {
81
- key: 2,
82
- class: "delete-icon",
83
- onClick: B(w, ["stop", "prevent"])
84
- }, {
85
- default: a(() => [
86
- n(c(E))
87
- ]),
88
- _: 1
89
- })) : C("", !0)
90
- ]),
91
- _: 3
92
- }, 8, ["action"]);
93
- };
94
- }
95
- }, $ = /* @__PURE__ */ I(V, [["__scopeId", "data-v-19c702c5"]]);
96
- export {
97
- $ as default
98
- };