vue-popup-plus-plugin-preset 1.3.2 → 1.3.3
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/dist/PAlert-C89sw_TB.js +69 -0
- package/dist/{PBody-CggbeZs9.js → PBody-AzUGJHWU.js} +2 -2
- package/dist/PConfirm-C2lpNya8.js +84 -0
- package/dist/PDialog-B9PpnGtv.js +72 -0
- package/dist/{PPrompt-uN5YNxdI.js → PPrompt-CpaP4HoC.js} +23 -21
- package/dist/vue-popup-plus-plugin-preset.d.ts +55 -15
- package/dist/vue-popup-plus-plugin-preset.js +104 -91
- package/dist/vue-popup-plus-plugin-preset.umd.cjs +3 -3
- package/package.json +2 -2
- package/dist/PAlert-m8ik2PUI.js +0 -67
- package/dist/PConfirm-D-ug3UAJ.js +0 -79
- package/dist/PDialog-QBGTHrYK.js +0 -72
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent as i, inject as c, createElementBlock as f, openBlock as m, createVNode as t, withCtx as e, createElementVNode as u, toDisplayString as l, createTextVNode as p } from "vue";
|
|
2
|
+
import { usePopup as P, POPUP_COMPONENT_INJECTS as C } from "vue-popup-plus";
|
|
3
|
+
import { P as g, a as _, b as B } from "./PBody-AzUGJHWU.js";
|
|
4
|
+
import { P as h } from "./PFooter-Cp_J7xg-.js";
|
|
5
|
+
import { P as N, a as x } from "./PButtonGroup-C-RNjqPq.js";
|
|
6
|
+
import { _ as y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const T = { class: "p-alert" }, b = { class: "content" }, v = /* @__PURE__ */ i({
|
|
8
|
+
name: "PAlert",
|
|
9
|
+
__name: "PAlert",
|
|
10
|
+
props: {
|
|
11
|
+
title: {},
|
|
12
|
+
headerClose: { type: Boolean },
|
|
13
|
+
content: {},
|
|
14
|
+
confirmText: {},
|
|
15
|
+
draggable: { type: Boolean }
|
|
16
|
+
},
|
|
17
|
+
setup(o) {
|
|
18
|
+
const r = P(), s = c(C.INSTANCE_ID);
|
|
19
|
+
function n() {
|
|
20
|
+
r.destroy(s);
|
|
21
|
+
}
|
|
22
|
+
return (E, a) => (m(), f("div", T, [
|
|
23
|
+
t(g, null, {
|
|
24
|
+
header: e(() => [
|
|
25
|
+
t(B, {
|
|
26
|
+
draggable: o.draggable,
|
|
27
|
+
hasCloseButton: o.headerClose,
|
|
28
|
+
title: o.title,
|
|
29
|
+
onClose: a[0] || (a[0] = (d) => n()),
|
|
30
|
+
iconClass: "alert"
|
|
31
|
+
}, null, 8, ["draggable", "hasCloseButton", "title"])
|
|
32
|
+
]),
|
|
33
|
+
footer: e(() => [
|
|
34
|
+
t(h, null, {
|
|
35
|
+
default: e(() => [
|
|
36
|
+
t(N, { align: "right" }, {
|
|
37
|
+
default: e(() => [
|
|
38
|
+
t(x, {
|
|
39
|
+
onClick: a[1] || (a[1] = (d) => n()),
|
|
40
|
+
theme: "primary"
|
|
41
|
+
}, {
|
|
42
|
+
default: e(() => [
|
|
43
|
+
p(l(o.confirmText), 1)
|
|
44
|
+
]),
|
|
45
|
+
_: 1
|
|
46
|
+
})
|
|
47
|
+
]),
|
|
48
|
+
_: 1
|
|
49
|
+
})
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
})
|
|
53
|
+
]),
|
|
54
|
+
default: e(() => [
|
|
55
|
+
t(_, null, {
|
|
56
|
+
default: e(() => [
|
|
57
|
+
u("div", b, l(o.content), 1)
|
|
58
|
+
]),
|
|
59
|
+
_: 1
|
|
60
|
+
})
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
})
|
|
64
|
+
]));
|
|
65
|
+
}
|
|
66
|
+
}), D = /* @__PURE__ */ y(v, [["__scopeId", "data-v-a4cda4ff"]]);
|
|
67
|
+
export {
|
|
68
|
+
D as default
|
|
69
|
+
};
|
|
@@ -13,7 +13,7 @@ const V = { class: "p-scaffold" }, x = { class: "body" }, j = /* @__PURE__ */ p(
|
|
|
13
13
|
c(a.$slots, "footer", {}, void 0, !0)
|
|
14
14
|
]));
|
|
15
15
|
}
|
|
16
|
-
}), Z = /* @__PURE__ */ g(j, [["__scopeId", "data-v-
|
|
16
|
+
}), Z = /* @__PURE__ */ g(j, [["__scopeId", "data-v-a0759a9a"]]), U = /* @__PURE__ */ p({
|
|
17
17
|
name: "PHeaderButton",
|
|
18
18
|
__name: "PHeaderButton",
|
|
19
19
|
props: {
|
|
@@ -120,7 +120,7 @@ const V = { class: "p-scaffold" }, x = { class: "body" }, j = /* @__PURE__ */ p(
|
|
|
120
120
|
c(a.$slots, "default", {}, void 0, !0)
|
|
121
121
|
], 2));
|
|
122
122
|
}
|
|
123
|
-
}), te = /* @__PURE__ */ g(G, [["__scopeId", "data-v-
|
|
123
|
+
}), te = /* @__PURE__ */ g(G, [["__scopeId", "data-v-232de61d"]]);
|
|
124
124
|
export {
|
|
125
125
|
Z as P,
|
|
126
126
|
te as a,
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { defineComponent as m, inject as u, createElementBlock as C, openBlock as p, createVNode as t, withCtx as e, createElementVNode as P, toDisplayString as a, createTextVNode as d } from "vue";
|
|
2
|
+
import { usePopup as g, POPUP_COMPONENT_INJECTS as x } from "vue-popup-plus";
|
|
3
|
+
import { P as B, a as y, b as N } from "./PBody-AzUGJHWU.js";
|
|
4
|
+
import { P as T } from "./PFooter-Cp_J7xg-.js";
|
|
5
|
+
import { P as _, a as f } from "./PButtonGroup-C-RNjqPq.js";
|
|
6
|
+
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const v = { class: "p-confirm" }, b = { class: "content" }, E = /* @__PURE__ */ m({
|
|
8
|
+
name: "PConfirm",
|
|
9
|
+
__name: "PConfirm",
|
|
10
|
+
props: {
|
|
11
|
+
title: {},
|
|
12
|
+
headerClose: { type: Boolean },
|
|
13
|
+
content: {},
|
|
14
|
+
confirmText: {},
|
|
15
|
+
cancelText: {},
|
|
16
|
+
draggable: { type: Boolean }
|
|
17
|
+
},
|
|
18
|
+
setup(o) {
|
|
19
|
+
const l = g(), r = u(x.INSTANCE_ID);
|
|
20
|
+
function c() {
|
|
21
|
+
l.destroy(r, !0);
|
|
22
|
+
}
|
|
23
|
+
function i() {
|
|
24
|
+
l.destroy(r, !1);
|
|
25
|
+
}
|
|
26
|
+
return (I, n) => (p(), C("div", v, [
|
|
27
|
+
t(B, null, {
|
|
28
|
+
header: e(() => [
|
|
29
|
+
t(N, {
|
|
30
|
+
draggable: o.draggable,
|
|
31
|
+
hasCloseButton: o.headerClose,
|
|
32
|
+
title: o.title,
|
|
33
|
+
onClose: n[0] || (n[0] = (s) => i()),
|
|
34
|
+
iconClass: "confirm"
|
|
35
|
+
}, null, 8, ["draggable", "hasCloseButton", "title"])
|
|
36
|
+
]),
|
|
37
|
+
footer: e(() => [
|
|
38
|
+
t(T, null, {
|
|
39
|
+
default: e(() => [
|
|
40
|
+
t(_, {
|
|
41
|
+
align: "right",
|
|
42
|
+
theme: "primary"
|
|
43
|
+
}, {
|
|
44
|
+
default: e(() => [
|
|
45
|
+
t(f, {
|
|
46
|
+
onClick: n[1] || (n[1] = (s) => i()),
|
|
47
|
+
type: "plain"
|
|
48
|
+
}, {
|
|
49
|
+
default: e(() => [
|
|
50
|
+
d(a(o.cancelText), 1)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}),
|
|
54
|
+
t(f, {
|
|
55
|
+
onClick: n[2] || (n[2] = (s) => c())
|
|
56
|
+
}, {
|
|
57
|
+
default: e(() => [
|
|
58
|
+
d(a(o.confirmText), 1)
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
})
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
})
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
})
|
|
68
|
+
]),
|
|
69
|
+
default: e(() => [
|
|
70
|
+
t(y, null, {
|
|
71
|
+
default: e(() => [
|
|
72
|
+
P("div", b, a(o.content), 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
})
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
})
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
}), j = /* @__PURE__ */ h(E, [["__scopeId", "data-v-35effe8a"]]);
|
|
82
|
+
export {
|
|
83
|
+
j as default
|
|
84
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent as y, inject as m, ref as h, computed as t, defineAsyncComponent as v, onMounted as B, createElementBlock as b, openBlock as a, normalizeClass as k, createVNode as l, createSlots as E, withCtx as n, createBlock as u, resolveDynamicComponent as N, mergeProps as S, createCommentVNode as D } from "vue";
|
|
2
|
+
import { usePopup as I, POPUP_COMPONENT_INJECTS as c } from "vue-popup-plus";
|
|
3
|
+
import { P as M, a as T, b as w, c as x } from "./PBody-AzUGJHWU.js";
|
|
4
|
+
import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const V = /* @__PURE__ */ y({
|
|
6
|
+
name: "PDialog",
|
|
7
|
+
__name: "PDialog",
|
|
8
|
+
props: {
|
|
9
|
+
id: {},
|
|
10
|
+
title: {},
|
|
11
|
+
customComponent: {},
|
|
12
|
+
customComponentProps: {},
|
|
13
|
+
header: { type: Boolean },
|
|
14
|
+
headerClose: { type: Boolean },
|
|
15
|
+
draggable: { type: Boolean },
|
|
16
|
+
debugMode: { type: Boolean }
|
|
17
|
+
},
|
|
18
|
+
setup(e) {
|
|
19
|
+
const r = I(), i = m(c.INSTANCE_ID), d = m(c.COMPUTED_VIEW_STYLE), s = h(1), C = t(
|
|
20
|
+
() => `${e.id}-${s.value}`
|
|
21
|
+
), f = t(() => typeof e.customComponent == "function" ? v(e.customComponent) : e.customComponent);
|
|
22
|
+
t(() => d.value.width), t(() => d.value.height), B(() => {
|
|
23
|
+
});
|
|
24
|
+
function p() {
|
|
25
|
+
s.value++;
|
|
26
|
+
}
|
|
27
|
+
function P() {
|
|
28
|
+
r.destroy(i);
|
|
29
|
+
}
|
|
30
|
+
return ($, o) => (a(), b("div", {
|
|
31
|
+
class: k(["p-dialog", { "no-header": !e.header }])
|
|
32
|
+
}, [
|
|
33
|
+
l(M, null, E({
|
|
34
|
+
default: n(() => [
|
|
35
|
+
l(T, { withPadding: !1 }, {
|
|
36
|
+
default: n(() => [
|
|
37
|
+
(a(), u(N(f.value), S({ key: C.value }, e.customComponentProps), null, 16))
|
|
38
|
+
]),
|
|
39
|
+
_: 1
|
|
40
|
+
})
|
|
41
|
+
]),
|
|
42
|
+
_: 2
|
|
43
|
+
}, [
|
|
44
|
+
e.header ? {
|
|
45
|
+
name: "header",
|
|
46
|
+
fn: n(() => [
|
|
47
|
+
l(w, {
|
|
48
|
+
draggable: e.draggable,
|
|
49
|
+
hasCloseButton: e.headerClose,
|
|
50
|
+
title: e.title,
|
|
51
|
+
onClose: o[1] || (o[1] = (g) => P())
|
|
52
|
+
}, {
|
|
53
|
+
buttons: n(() => [
|
|
54
|
+
e.debugMode ? (a(), u(x, {
|
|
55
|
+
key: 0,
|
|
56
|
+
onClick: o[0] || (o[0] = (g) => p()),
|
|
57
|
+
iconClass: "reload",
|
|
58
|
+
theme: "success"
|
|
59
|
+
})) : D("", !0)
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
}, 8, ["draggable", "hasCloseButton", "title"])
|
|
63
|
+
]),
|
|
64
|
+
key: "0"
|
|
65
|
+
} : void 0
|
|
66
|
+
]), 1024)
|
|
67
|
+
], 2));
|
|
68
|
+
}
|
|
69
|
+
}), j = /* @__PURE__ */ O(V, [["__scopeId", "data-v-5a6ff495"]]);
|
|
70
|
+
export {
|
|
71
|
+
j as default
|
|
72
|
+
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { usePopup as
|
|
1
|
+
import { defineComponent as y, inject as C, ref as v, computed as B, createElementBlock as d, openBlock as r, createVNode as l, withCtx as a, createCommentVNode as s, createElementVNode as N, toDisplayString as i, withDirectives as f, vModelText as p, createTextVNode as g } from "vue";
|
|
2
|
+
import { usePopup as T, POPUP_COMPONENT_INJECTS as V } from "vue-popup-plus";
|
|
3
3
|
import "./vue-popup-plus-plugin-preset.js";
|
|
4
|
-
import { P as
|
|
4
|
+
import { P as k, a as L, b } from "./PBody-AzUGJHWU.js";
|
|
5
5
|
import { P as E } from "./PFooter-Cp_J7xg-.js";
|
|
6
|
-
import { P as I, a as
|
|
6
|
+
import { P as I, a as h } from "./PButtonGroup-C-RNjqPq.js";
|
|
7
7
|
import { _ as S } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const D = { class: "p-prompt" }, M = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "message"
|
|
11
|
-
}, O = { class: "input" }, U = ["maxLength", "placeholder"], $ = ["maxLength", "placeholder"], w = /* @__PURE__ */
|
|
11
|
+
}, O = { class: "input" }, U = ["maxLength", "placeholder"], $ = ["maxLength", "placeholder"], w = /* @__PURE__ */ y({
|
|
12
12
|
name: "PPrompt",
|
|
13
13
|
__name: "PPrompt",
|
|
14
14
|
props: {
|
|
15
15
|
title: {},
|
|
16
|
+
headerClose: { type: Boolean },
|
|
16
17
|
message: { type: [String, Boolean] },
|
|
17
18
|
type: {},
|
|
18
19
|
defaultValue: {},
|
|
@@ -23,22 +24,23 @@ const D = { class: "p-prompt" }, M = {
|
|
|
23
24
|
draggable: { type: Boolean }
|
|
24
25
|
},
|
|
25
26
|
setup(e) {
|
|
26
|
-
const
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
const u = T(), m = C(V.INSTANCE_ID), n = v(e.defaultValue), x = B(() => e.message !== !1);
|
|
28
|
+
function P() {
|
|
29
|
+
u.destroy(m, n.value);
|
|
29
30
|
}
|
|
30
31
|
function c() {
|
|
31
|
-
|
|
32
|
+
u.destroy(m);
|
|
32
33
|
}
|
|
33
34
|
return (j, t) => (r(), d("div", D, [
|
|
34
|
-
l(
|
|
35
|
+
l(k, null, {
|
|
35
36
|
header: a(() => [
|
|
36
37
|
l(b, {
|
|
37
38
|
draggable: e.draggable,
|
|
39
|
+
hasCloseButton: e.headerClose,
|
|
38
40
|
title: e.title,
|
|
39
41
|
onClose: t[0] || (t[0] = (o) => c()),
|
|
40
42
|
iconClass: "prompt"
|
|
41
|
-
}, null, 8, ["draggable", "title"])
|
|
43
|
+
}, null, 8, ["draggable", "hasCloseButton", "title"])
|
|
42
44
|
]),
|
|
43
45
|
footer: a(() => [
|
|
44
46
|
l(E, null, {
|
|
@@ -48,20 +50,20 @@ const D = { class: "p-prompt" }, M = {
|
|
|
48
50
|
theme: "primary"
|
|
49
51
|
}, {
|
|
50
52
|
default: a(() => [
|
|
51
|
-
l(
|
|
53
|
+
l(h, {
|
|
52
54
|
onClick: t[3] || (t[3] = (o) => c()),
|
|
53
55
|
type: "plain"
|
|
54
56
|
}, {
|
|
55
57
|
default: a(() => [
|
|
56
|
-
g(
|
|
58
|
+
g(i(e.cancelText), 1)
|
|
57
59
|
]),
|
|
58
60
|
_: 1
|
|
59
61
|
}),
|
|
60
|
-
l(
|
|
61
|
-
onClick: t[4] || (t[4] = (o) =>
|
|
62
|
+
l(h, {
|
|
63
|
+
onClick: t[4] || (t[4] = (o) => P())
|
|
62
64
|
}, {
|
|
63
65
|
default: a(() => [
|
|
64
|
-
g(
|
|
66
|
+
g(i(e.confirmText), 1)
|
|
65
67
|
]),
|
|
66
68
|
_: 1
|
|
67
69
|
})
|
|
@@ -75,8 +77,8 @@ const D = { class: "p-prompt" }, M = {
|
|
|
75
77
|
default: a(() => [
|
|
76
78
|
l(L, null, {
|
|
77
79
|
default: a(() => [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
x.value ? (r(), d("div", M, i(e.message), 1)) : s("", !0),
|
|
81
|
+
N("div", O, [
|
|
80
82
|
e.type === "input" ? f((r(), d("input", {
|
|
81
83
|
key: 0,
|
|
82
84
|
maxLength: e.maxLength,
|
|
@@ -85,7 +87,7 @@ const D = { class: "p-prompt" }, M = {
|
|
|
85
87
|
"onUpdate:modelValue": t[1] || (t[1] = (o) => n.value = o)
|
|
86
88
|
}, null, 8, U)), [
|
|
87
89
|
[p, n.value]
|
|
88
|
-
]) :
|
|
90
|
+
]) : s("", !0),
|
|
89
91
|
e.type === "textarea" ? f((r(), d("textarea", {
|
|
90
92
|
key: 1,
|
|
91
93
|
maxLength: e.maxLength,
|
|
@@ -93,7 +95,7 @@ const D = { class: "p-prompt" }, M = {
|
|
|
93
95
|
"onUpdate:modelValue": t[2] || (t[2] = (o) => n.value = o)
|
|
94
96
|
}, null, 8, $)), [
|
|
95
97
|
[p, n.value]
|
|
96
|
-
]) :
|
|
98
|
+
]) : s("", !0)
|
|
97
99
|
])
|
|
98
100
|
]),
|
|
99
101
|
_: 1
|
|
@@ -103,7 +105,7 @@ const D = { class: "p-prompt" }, M = {
|
|
|
103
105
|
})
|
|
104
106
|
]));
|
|
105
107
|
}
|
|
106
|
-
}), z = /* @__PURE__ */ S(w, [["__scopeId", "data-v-
|
|
108
|
+
}), z = /* @__PURE__ */ S(w, [["__scopeId", "data-v-a8dca71f"]]);
|
|
107
109
|
export {
|
|
108
110
|
z as default
|
|
109
111
|
};
|
|
@@ -51,6 +51,11 @@ declare type AlertOption = {
|
|
|
51
51
|
* - 默认值:`提示`
|
|
52
52
|
*/
|
|
53
53
|
title?: string;
|
|
54
|
+
/**
|
|
55
|
+
* 标题栏是否显示关闭按钮
|
|
56
|
+
* - 默认值:`true`
|
|
57
|
+
*/
|
|
58
|
+
headerClose?: boolean;
|
|
54
59
|
/**
|
|
55
60
|
* 确认按钮文本
|
|
56
61
|
* - 默认值:`确定`
|
|
@@ -66,6 +71,11 @@ declare type AlertOption = {
|
|
|
66
71
|
* - 默认值:`false`
|
|
67
72
|
*/
|
|
68
73
|
dragOverflow?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 遮罩层是否模糊
|
|
76
|
+
* - 默认值:`true`
|
|
77
|
+
*/
|
|
78
|
+
maskBlur?: boolean;
|
|
69
79
|
};
|
|
70
80
|
|
|
71
81
|
declare type ConfirmOption = {
|
|
@@ -74,6 +84,11 @@ declare type ConfirmOption = {
|
|
|
74
84
|
* - 默认值:`确认`
|
|
75
85
|
*/
|
|
76
86
|
title?: string;
|
|
87
|
+
/**
|
|
88
|
+
* 标题栏是否显示关闭按钮
|
|
89
|
+
* - 默认值:`false`
|
|
90
|
+
*/
|
|
91
|
+
headerClose?: boolean;
|
|
77
92
|
/**
|
|
78
93
|
* 确认按钮文本
|
|
79
94
|
* - 默认值:`确定`
|
|
@@ -94,6 +109,11 @@ declare type ConfirmOption = {
|
|
|
94
109
|
* - 默认值:`false`
|
|
95
110
|
*/
|
|
96
111
|
dragOverflow?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 遮罩层是否模糊
|
|
114
|
+
* - 默认值:`true`
|
|
115
|
+
*/
|
|
116
|
+
maskBlur?: boolean;
|
|
97
117
|
};
|
|
98
118
|
|
|
99
119
|
declare const _default: PopupPlugin;
|
|
@@ -166,7 +186,7 @@ export declare interface IDialog {
|
|
|
166
186
|
* - 如需获取对话框关闭时传递的参数,可在调用 `dialog` 方法时使用 `await` 关键字等待 Promise resolve 后获取
|
|
167
187
|
* - 对话框关闭时,无论是否传递了参数,Promise 都将 resolve,因此需要在调用时判断是否有返回参数
|
|
168
188
|
*/
|
|
169
|
-
<T extends any = any>(options: PopupDialogOption): Promise<T |
|
|
189
|
+
<T extends any = any>(options: PopupDialogOption): Promise<T | void>;
|
|
170
190
|
}
|
|
171
191
|
|
|
172
192
|
export declare interface ILoading {
|
|
@@ -189,14 +209,19 @@ export declare interface IPrompt {
|
|
|
189
209
|
* - 可以在提示用户的同时,获取用户输入的内容,支持输入框和文本域
|
|
190
210
|
* - 第一个参数为提示文本,如果不需要渲染提示文本,传入 `false` 即可
|
|
191
211
|
* - 第二个参数为输入框默认值,第三个参数为选项对象,可以自定义输入框类型、标题、最大长度、占位符、确认按钮文本、取消按钮文本等,具体可以参考 {@link PromptOption}
|
|
192
|
-
* - 获取输入的内容,需要通过 `await` 调用,等待执行结束后返回用户输入的内容,类型为 `string` | `
|
|
212
|
+
* - 获取输入的内容,需要通过 `await` 调用,等待执行结束后返回用户输入的内容,类型为 `string` | `void`,如果用户点击了取消按钮或者直接关闭弹出层,则返回 `undefined`
|
|
193
213
|
* - 使用示例:
|
|
194
214
|
* ```ts
|
|
195
215
|
*
|
|
196
216
|
* const name = await popup.prompt('请输入您的姓名')
|
|
217
|
+
* if (name === undefined) {
|
|
218
|
+
* console.log('用户取消了输入')
|
|
219
|
+
* } else {
|
|
220
|
+
* console.log('您的姓名是:' + name)
|
|
221
|
+
* }
|
|
197
222
|
* ```
|
|
198
223
|
*/
|
|
199
|
-
(message: string | boolean, defaultValue?: string, options?: PromptOption): Promise<string>;
|
|
224
|
+
(message: string | boolean, defaultValue?: string, options?: PromptOption): Promise<string | void>;
|
|
200
225
|
}
|
|
201
226
|
|
|
202
227
|
export declare interface IToast {
|
|
@@ -224,7 +249,7 @@ declare type LoadingOption = {
|
|
|
224
249
|
declare type PopupDialogOption = {
|
|
225
250
|
/**
|
|
226
251
|
* 对话框标题
|
|
227
|
-
* - 默认值为
|
|
252
|
+
* - 默认值为 `对话`
|
|
228
253
|
*/
|
|
229
254
|
title?: string;
|
|
230
255
|
/**
|
|
@@ -234,17 +259,21 @@ declare type PopupDialogOption = {
|
|
|
234
259
|
/**
|
|
235
260
|
* 对话框内容组件props
|
|
236
261
|
*/
|
|
237
|
-
|
|
262
|
+
componentProps?: Record<string, any>;
|
|
263
|
+
/**
|
|
264
|
+
* 对话框渲染完成时调用的回调函数
|
|
265
|
+
*/
|
|
266
|
+
onMounted?: () => void;
|
|
238
267
|
/**
|
|
239
268
|
* 是否显示对话框标题栏
|
|
240
269
|
* - 默认值为 `true`
|
|
241
270
|
*/
|
|
242
271
|
header?: boolean;
|
|
243
272
|
/**
|
|
244
|
-
*
|
|
245
|
-
* -
|
|
273
|
+
* 标题栏是否显示关闭按钮
|
|
274
|
+
* - 默认值:`true`
|
|
246
275
|
*/
|
|
247
|
-
|
|
276
|
+
headerClose?: boolean;
|
|
248
277
|
/**
|
|
249
278
|
* 对话框宽度
|
|
250
279
|
* - 默认值为 `auto`
|
|
@@ -302,9 +331,10 @@ declare type PopupDialogOption = {
|
|
|
302
331
|
*/
|
|
303
332
|
dragOverflow?: boolean;
|
|
304
333
|
/**
|
|
305
|
-
*
|
|
334
|
+
* 遮罩层是否模糊
|
|
335
|
+
* - 默认值:`true`
|
|
306
336
|
*/
|
|
307
|
-
|
|
337
|
+
maskBlur?: boolean;
|
|
308
338
|
};
|
|
309
339
|
|
|
310
340
|
declare type PromptOption = {
|
|
@@ -320,6 +350,11 @@ declare type PromptOption = {
|
|
|
320
350
|
* - 默认值:`提示输入`
|
|
321
351
|
*/
|
|
322
352
|
title?: string;
|
|
353
|
+
/**
|
|
354
|
+
* 标题栏是否显示关闭按钮
|
|
355
|
+
* - 默认值:`true`
|
|
356
|
+
*/
|
|
357
|
+
headerClose?: boolean;
|
|
323
358
|
/**
|
|
324
359
|
* 提示输入框最大长度
|
|
325
360
|
* - 默认值:`null`
|
|
@@ -350,6 +385,11 @@ declare type PromptOption = {
|
|
|
350
385
|
* - 默认值:`false`
|
|
351
386
|
*/
|
|
352
387
|
dragOverflow?: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* 遮罩层是否模糊
|
|
390
|
+
* - 默认值:`true`
|
|
391
|
+
*/
|
|
392
|
+
maskBlur?: boolean;
|
|
353
393
|
};
|
|
354
394
|
|
|
355
395
|
declare type PromptType = 'input' | 'textarea';
|
|
@@ -376,14 +416,14 @@ export { }
|
|
|
376
416
|
|
|
377
417
|
declare module 'vue-popup-plus' {
|
|
378
418
|
interface PopupCustomProperties {
|
|
379
|
-
|
|
419
|
+
album: IAlbum;
|
|
380
420
|
}
|
|
381
421
|
}
|
|
382
422
|
|
|
383
423
|
|
|
384
424
|
declare module 'vue-popup-plus' {
|
|
385
425
|
interface PopupCustomProperties {
|
|
386
|
-
|
|
426
|
+
alert: IAlert;
|
|
387
427
|
}
|
|
388
428
|
}
|
|
389
429
|
|
|
@@ -397,21 +437,21 @@ declare module 'vue-popup-plus' {
|
|
|
397
437
|
|
|
398
438
|
declare module 'vue-popup-plus' {
|
|
399
439
|
interface PopupCustomProperties {
|
|
400
|
-
|
|
440
|
+
loading: ILoading;
|
|
401
441
|
}
|
|
402
442
|
}
|
|
403
443
|
|
|
404
444
|
|
|
405
445
|
declare module 'vue-popup-plus' {
|
|
406
446
|
interface PopupCustomProperties {
|
|
407
|
-
|
|
447
|
+
toast: IToast;
|
|
408
448
|
}
|
|
409
449
|
}
|
|
410
450
|
|
|
411
451
|
|
|
412
452
|
declare module 'vue-popup-plus' {
|
|
413
453
|
interface PopupCustomProperties {
|
|
414
|
-
|
|
454
|
+
confirm: IConfirm;
|
|
415
455
|
}
|
|
416
456
|
}
|
|
417
457
|
|