stellar-ui-v2 1.40.31 → 1.40.32
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/components/ste-message-box/ste-message-box.js +23 -38
- package/components/ste-message-box/ste-message-box.vue +364 -364
- package/components/ste-page-container/README.md +83 -83
- package/components/ste-page-container/WORKLOG-2026-03-12.md +229 -229
- package/components/ste-page-container/ste-page-container.vue +190 -190
- package/components/ste-popup/README.md +16 -16
- package/components/ste-popup/ste-popup.vue +392 -392
- package/components/ste-price/ste-price.vue +256 -256
- package/components/ste-search/ste-search.vue +576 -576
- package/components/ste-toast/README.md +3 -0
- package/components/ste-toast/ste-toast.js +67 -69
- package/components/ste-video/ste-video.vue +756 -756
- package/config/color.js +6 -8
- package/package.json +2 -2
- package/utils/store.js +0 -7
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
-
import Vuex from 'vuex';
|
|
3
2
|
|
|
4
|
-
Vue.use(Vuex);
|
|
5
3
|
const DEFAULT_KEY = '$steMsgBoxKey';
|
|
6
4
|
const DEFAULT_CONFIG = {
|
|
7
5
|
title: '',
|
|
@@ -19,52 +17,39 @@ const DEFAULT_CONFIG = {
|
|
|
19
17
|
complete: null,
|
|
20
18
|
};
|
|
21
19
|
|
|
22
|
-
const
|
|
23
|
-
state: {},
|
|
24
|
-
mutations: {
|
|
25
|
-
initializeState(state, key) {
|
|
26
|
-
if (!state[key]) {
|
|
27
|
-
Vue.set(state, key, {
|
|
28
|
-
selector: key,
|
|
29
|
-
openBegin: false,
|
|
30
|
-
...DEFAULT_CONFIG,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
setState(state, { key, params }) {
|
|
35
|
-
Object.assign(state[key], params);
|
|
36
|
-
},
|
|
37
|
-
resetState(state, key) {
|
|
38
|
-
Object.assign(state[key], {
|
|
39
|
-
openBegin: false,
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
});
|
|
20
|
+
const stateMap = Vue.observable({});
|
|
44
21
|
|
|
45
22
|
function useSteMsgBox(key) {
|
|
46
23
|
key = key ?? DEFAULT_KEY;
|
|
47
|
-
|
|
24
|
+
// 初始化状态
|
|
25
|
+
if (!stateMap[key]) {
|
|
26
|
+
Vue.set(stateMap, key, {
|
|
27
|
+
selector: key,
|
|
28
|
+
openBegin: false,
|
|
29
|
+
...DEFAULT_CONFIG,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
48
32
|
|
|
49
33
|
return {
|
|
34
|
+
// 显示消息弹框
|
|
50
35
|
showMsgBox(params) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
params
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
complete: params.complete ?? function () {},
|
|
59
|
-
openBegin: true,
|
|
60
|
-
},
|
|
36
|
+
Object.assign(stateMap[key], {
|
|
37
|
+
...DEFAULT_CONFIG,
|
|
38
|
+
...params,
|
|
39
|
+
confirm: params.confirm ?? function () {},
|
|
40
|
+
cancel: params.cancel ?? function () {},
|
|
41
|
+
complete: params.complete ?? function () {},
|
|
42
|
+
openBegin: true,
|
|
61
43
|
});
|
|
62
44
|
},
|
|
45
|
+
// 关闭消息弹框
|
|
63
46
|
hideMsgBox() {
|
|
64
|
-
|
|
47
|
+
Object.assign(stateMap[key], {
|
|
48
|
+
openBegin: false,
|
|
49
|
+
});
|
|
65
50
|
},
|
|
66
|
-
|
|
67
|
-
$
|
|
51
|
+
// 响应式数据
|
|
52
|
+
$state: stateMap[key],
|
|
68
53
|
};
|
|
69
54
|
}
|
|
70
55
|
|