uview-plus 3.4.3 → 3.4.4
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/changelog.md
CHANGED
|
@@ -87,5 +87,16 @@ export const props = defineMixin({
|
|
|
87
87
|
type: String,
|
|
88
88
|
default: () => defProps.modal.contentTextAlign
|
|
89
89
|
},
|
|
90
|
+
// 异步确定时如果点击了取消时候的提示文案
|
|
91
|
+
asyncCloseTip: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: () => defProps.modal.asyncCloseTip
|
|
94
|
+
},
|
|
95
|
+
// 是否异步关闭,只对取消按钮有效
|
|
96
|
+
asyncCancelClose: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: () => defProps.modal.asyncCancelClose
|
|
99
|
+
},
|
|
100
|
+
|
|
90
101
|
}
|
|
91
102
|
})
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
if (n && this.loading) this.loading = false
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
|
-
emits: ["confirm", "cancel", "close", "update:show"],
|
|
140
|
+
emits: ["confirm", "cancel", "close", "update:show", 'cancelOnAsync'],
|
|
141
141
|
methods: {
|
|
142
142
|
addUnit,
|
|
143
143
|
// 点击确定按钮
|
|
@@ -152,7 +152,21 @@
|
|
|
152
152
|
},
|
|
153
153
|
// 点击取消按钮
|
|
154
154
|
cancelHandler() {
|
|
155
|
-
|
|
155
|
+
// 如果点击了确定按钮,确定按钮正在请求接口执行异步操作,那么限制不能取消。
|
|
156
|
+
if (this.asyncClose && this.loading) {
|
|
157
|
+
if (this.asyncCloseTip) {
|
|
158
|
+
uni.showToast({
|
|
159
|
+
title: this.asyncCloseTip,
|
|
160
|
+
icon: 'none'
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
this.$emit('cancelOnAsync')
|
|
164
|
+
} else {
|
|
165
|
+
// 如果配置了取消时异步关闭
|
|
166
|
+
if (!this.asyncCancelClose) {
|
|
167
|
+
this.$emit('update:show', false)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
156
170
|
this.$emit('cancel')
|
|
157
171
|
},
|
|
158
172
|
// 点击遮罩
|
package/package.json
CHANGED
package/types/comps/toast.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AllowedComponentProps, VNodeProps } from './_common'
|
|
2
2
|
|
|
3
3
|
declare interface ToastProps {
|
|
4
|
+
/**
|
|
5
|
+
* 层级
|
|
6
|
+
*/
|
|
7
|
+
zIndex?: string | number
|
|
4
8
|
/**
|
|
5
9
|
* 是否加载中
|
|
6
10
|
* @default false
|
|
@@ -43,7 +47,7 @@ declare interface _ToastRef {
|
|
|
43
47
|
/**
|
|
44
48
|
* 显示toast,如需一进入页面就显示toast,请在onReady生命周期调用
|
|
45
49
|
*/
|
|
46
|
-
show: () => void
|
|
50
|
+
show: (options: ToastProps) => void
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
declare interface _Toast {
|