mali-applet-ui 1.0.8 → 1.0.9
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/modal/modal.js +19 -9
- package/package.json +1 -1
package/modal/modal.js
CHANGED
|
@@ -9,13 +9,16 @@ const MaliModal = {
|
|
|
9
9
|
confirmText: option.confirmButtonText || '确认',
|
|
10
10
|
cancelText: option.cancelButtonText || '取消',
|
|
11
11
|
success (res) {
|
|
12
|
+
let type
|
|
12
13
|
if (res.confirm) {
|
|
13
|
-
|
|
14
|
+
type = 'confirm'
|
|
14
15
|
} else if (res.cancel) {
|
|
15
|
-
|
|
16
|
-
} else {
|
|
17
|
-
resolve()
|
|
16
|
+
type = 'cancel'
|
|
18
17
|
}
|
|
18
|
+
if (option.callback) {
|
|
19
|
+
option.callback(type)
|
|
20
|
+
}
|
|
21
|
+
resolve(type)
|
|
19
22
|
}
|
|
20
23
|
})
|
|
21
24
|
})
|
|
@@ -28,7 +31,11 @@ const MaliModal = {
|
|
|
28
31
|
showCancel: false,
|
|
29
32
|
confirmText: option.confirmButtonText || '确认',
|
|
30
33
|
success () {
|
|
31
|
-
|
|
34
|
+
const type = 'confirm'
|
|
35
|
+
if (option.callback) {
|
|
36
|
+
option.callback(type)
|
|
37
|
+
}
|
|
38
|
+
resolve(type)
|
|
32
39
|
}
|
|
33
40
|
})
|
|
34
41
|
})
|
|
@@ -42,13 +49,16 @@ const MaliModal = {
|
|
|
42
49
|
confirmText: option.confirmButtonText || '确认',
|
|
43
50
|
cancelText: option.cancelButtonText || '取消',
|
|
44
51
|
success (res) {
|
|
52
|
+
let type
|
|
45
53
|
if (res.confirm) {
|
|
46
|
-
|
|
54
|
+
type = 'confirm'
|
|
47
55
|
} else if (res.cancel) {
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
56
|
+
type = 'cancel'
|
|
57
|
+
}
|
|
58
|
+
if (option.callback) {
|
|
59
|
+
option.callback(type)
|
|
51
60
|
}
|
|
61
|
+
resolve(type)
|
|
52
62
|
}
|
|
53
63
|
})
|
|
54
64
|
})
|