command-center-v3-common 0.0.18 → 0.0.20

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.
@@ -1,93 +0,0 @@
1
- import { defineComponent as _, ref as p, resolveComponent as i, openBlock as g, createElementBlock as v, Fragment as h, createElementVNode as r, unref as x, createVNode as t, withCtx as c, createTextVNode as s } from "vue";
2
- import { f as C } from "./command-center-v3-common-8JifopwY.js";
3
- const w = { class: "flex flex-col items-center justify-center gap-6" }, y = ["src"], b = { class: "flex items-center gap-x-3" }, S = /* @__PURE__ */ _({
4
- __name: "vue-cropper-demo",
5
- setup(B) {
6
- const e = p(), a = p("https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg");
7
- async function f() {
8
- const n = {
9
- img: a.value
10
- };
11
- await e.value.onShowModal(n), a.value = await e.value.getCropData();
12
- }
13
- function u() {
14
- a.value = "https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg";
15
- }
16
- async function d(n) {
17
- const o = {
18
- img: await e.value.getBlobToData(n),
19
- outputType: "png",
20
- // 裁剪生成图片的格式
21
- canScale: !0,
22
- // 图片是否允许滚轮缩放
23
- fixedBox: !0,
24
- // 固定截图框大小 不允许改变
25
- infoTrue: !1,
26
- // 是否开启截图框宽高固定比例
27
- autoCropWidth: 70,
28
- autoCropHeight: 70,
29
- centerBox: !1,
30
- original: !0,
31
- fixed: !1
32
- };
33
- await e.value.onShowModal(o);
34
- const l = await e.value.getCropBlob();
35
- console.log(l);
36
- }
37
- return (n, m) => {
38
- const o = i("el-button"), l = i("el-upload");
39
- return g(), v(h, null, [
40
- r("div", w, [
41
- r("img", {
42
- src: x(a),
43
- class: "rounded-xl"
44
- }, null, 8, y),
45
- t(l, {
46
- accept: ".png,.jpg,.gif",
47
- "before-upload": d,
48
- action: "",
49
- class: "relative group overflow-hidden",
50
- "show-file-list": !1
51
- }, {
52
- default: c(() => [
53
- t(o, { type: "primary" }, {
54
- default: c(() => [
55
- s(" 上传图片 ")
56
- ]),
57
- _: 1
58
- })
59
- ]),
60
- _: 1
61
- }),
62
- r("div", b, [
63
- t(o, {
64
- type: "primary",
65
- onClick: f
66
- }, {
67
- default: c(() => [
68
- s(" 图片裁剪 ")
69
- ]),
70
- _: 1
71
- }),
72
- t(o, {
73
- type: "primary",
74
- onClick: u
75
- }, {
76
- default: c(() => [
77
- s(" 还原 ")
78
- ]),
79
- _: 1
80
- })
81
- ])
82
- ]),
83
- t(C, {
84
- ref_key: "vueCropper",
85
- ref: e
86
- }, null, 512)
87
- ], 64);
88
- };
89
- }
90
- });
91
- export {
92
- S as default
93
- };