uview-plus 3.4.2 → 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 +11 -0
- package/components/u-modal/modal.js +3 -1
- package/components/u-modal/props.js +11 -0
- package/components/u-modal/u-modal.vue +16 -2
- package/components/u-textarea/u-textarea.vue +11 -2
- package/components/u-toast/toast.js +1 -1
- package/package.json +1 -1
- package/types/comps/toast.d.ts +5 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 3.4.4(2025-03-13)
|
|
2
|
+
feat: modal增加异步操作进行中点击取消弹出提示特性防止操作被中断
|
|
3
|
+
|
|
4
|
+
fix: 修复toast组件show方法类型声明
|
|
5
|
+
|
|
6
|
+
## 3.4.3(2025-03-12)
|
|
7
|
+
fix: 修复textarea自动增高时在输入时高度异常
|
|
8
|
+
|
|
9
|
+
## 3.4.2(2025-03-11)
|
|
10
|
+
feat: step组件增加title插槽及增加辅助class便于自定义样式
|
|
11
|
+
|
|
1
12
|
## 3.4.1(2025-03-11)
|
|
2
13
|
feat: 新机制确保setConfig与http在nvue等环境下生效
|
|
3
14
|
|
|
@@ -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
|
// 点击遮罩
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<textarea
|
|
4
4
|
class="u-textarea__field"
|
|
5
5
|
:value="innerValue"
|
|
6
|
-
:style="
|
|
6
|
+
:style="fieldStyle"
|
|
7
7
|
:placeholder="placeholder"
|
|
8
8
|
:placeholder-style="addStyle(placeholderStyle, typeof placeholderStyle === 'string' ? 'string' : 'object')"
|
|
9
9
|
:placeholder-class="placeholderClass"
|
|
@@ -145,7 +145,16 @@ export default {
|
|
|
145
145
|
}
|
|
146
146
|
// #endif
|
|
147
147
|
},
|
|
148
|
-
computed: {
|
|
148
|
+
computed: {
|
|
149
|
+
fieldStyle() {
|
|
150
|
+
let style = {};
|
|
151
|
+
style['height'] = addUnit(this.height);
|
|
152
|
+
if (this.autoHeight) {
|
|
153
|
+
style['height'] = 'auto';
|
|
154
|
+
style['minHeight'] = addUnit(this.height);
|
|
155
|
+
}
|
|
156
|
+
return style;
|
|
157
|
+
},
|
|
149
158
|
// 组件的类名
|
|
150
159
|
textareaClass() {
|
|
151
160
|
let classes = [],
|
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 {
|