sard-uniapp 1.25.0 → 1.25.2
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 +21 -0
- package/components/cascader/common.js +5 -3
- package/components/config/index.js +2 -0
- package/components/input/input.vue +17 -7
- package/components/locale/lang/vi-VN.d.ts +126 -0
- package/components/locale/lang/vi-VN.js +126 -0
- package/components/popout/README.md +22 -17
- package/components/popout/common.d.ts +200 -0
- package/components/popout/popout.d.ts +5 -0
- package/components/popout/popout.vue +15 -0
- package/components/popup/README.md +2 -0
- package/components/popup/popup.vue +2 -0
- package/components/qrcode/README.md +6 -0
- package/components/qrcode/common.d.ts +3 -0
- package/components/qrcode/qrcode.d.ts +5 -1
- package/components/qrcode/qrcode.vue +9 -3
- package/components/share-sheet/share-sheet.vue +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.25.2](https://github.com/sutras/sard-uniapp/compare/v1.25.1...v1.25.2) (2025-11-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **cascader:** 节点值相同时优先绑定后代节点 ([3937b2d](https://github.com/sutras/sard-uniapp/commit/3937b2d3ee47afe875d5d1544d211ca31f7490a0))
|
|
7
|
+
* **input:** 修复web端最大字数限制无效问题 ([8811d13](https://github.com/sutras/sard-uniapp/commit/8811d13ef1c5294ad16fb52b1d1b56fd2c37f356))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [1.25.1](https://github.com/sutras/sard-uniapp/compare/v1.25.0...v1.25.1) (2025-11-07)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **locale:** 添加越南语语言包 ([8f1611a](https://github.com/sutras/sard-uniapp/commit/8f1611a73e9f291ea4a64c23319de1b646de7457))
|
|
17
|
+
* **popout:** 添加遮罩相关属性 ([8ee1ad8](https://github.com/sutras/sard-uniapp/commit/8ee1ad86787f8ff970fcf60cb305aa4c484537df))
|
|
18
|
+
* **qrcode:** 新增success事件 ([91195a9](https://github.com/sutras/sard-uniapp/commit/91195a9a13f14b518421811c95c29d3f364ee88f))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
1
22
|
# [1.25.0](https://github.com/sutras/sard-uniapp/compare/v1.24.7...v1.25.0) (2025-11-03)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -24,15 +24,17 @@ export function getSelectedOptionsByValue(options, value, fieldKeys) {
|
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
for (const option of options) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
27
|
+
// 优先在子结点中查找,找到后再向上回溯路径
|
|
28
|
+
// 这样可以处理存在重复值场景时候更偏向于更深层次的选项
|
|
30
29
|
if (Array.isArray(option[fieldKeys.children])) {
|
|
31
30
|
const selectedOptions = getSelectedOptionsByValue(option[fieldKeys.children], value, fieldKeys);
|
|
32
31
|
if (selectedOptions) {
|
|
33
32
|
return [option, ...selectedOptions];
|
|
34
33
|
}
|
|
35
34
|
}
|
|
35
|
+
if (option[fieldKeys.value] === value) {
|
|
36
|
+
return [option];
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -200,6 +200,7 @@ export const defaultConfig = {
|
|
|
200
200
|
},
|
|
201
201
|
input: {
|
|
202
202
|
enableNative: false,
|
|
203
|
+
controlled: true,
|
|
203
204
|
maxlength: 140,
|
|
204
205
|
adjustPosition: true,
|
|
205
206
|
ignoreCompositionEvent: true,
|
|
@@ -271,6 +272,7 @@ export const defaultConfig = {
|
|
|
271
272
|
showConfirm: true,
|
|
272
273
|
showClose: true,
|
|
273
274
|
showFooter: true,
|
|
275
|
+
overlay: true,
|
|
274
276
|
overlayClosable: true,
|
|
275
277
|
duration: 250,
|
|
276
278
|
},
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
)
|
|
18
18
|
"
|
|
19
19
|
:enableNative="enableNative"
|
|
20
|
+
:controlled="controlled"
|
|
20
21
|
:value="innerValue"
|
|
21
22
|
:placeholder="placeholder"
|
|
22
23
|
:placeholder-style="mergedPlaceholderStyle"
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
:fixed="fixed"
|
|
39
40
|
:show-confirm-bar="showConfirmBar"
|
|
40
41
|
:disable-default-padding="disableDefaultPadding"
|
|
42
|
+
:maxlength="maxLength"
|
|
41
43
|
@input="onInput"
|
|
42
44
|
@focus="onFocus"
|
|
43
45
|
@blur="onBlur"
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
v-if="type !== 'textarea' && showPassword"
|
|
53
55
|
:class="classNames(bem.e('control'), bem.em('control', 'input'))"
|
|
54
56
|
:enableNative="enableNative"
|
|
57
|
+
:controlled="controlled"
|
|
55
58
|
:value="innerValue"
|
|
56
59
|
:placeholder="placeholder"
|
|
57
60
|
:placeholder-style="mergedPlaceholderStyle"
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
:ignore-composition-event="ignoreCompositionEvent"
|
|
71
74
|
:inputmode="inputmode"
|
|
72
75
|
autocomplete="off"
|
|
76
|
+
:maxlength="maxLength"
|
|
73
77
|
@input="onInput"
|
|
74
78
|
@focus="onFocus"
|
|
75
79
|
@blur="onBlur"
|
|
@@ -85,12 +89,12 @@
|
|
|
85
89
|
:safe-password-salt="safePasswordSalt"
|
|
86
90
|
:safe-password-custom-hash="safePasswordCustomHash"
|
|
87
91
|
:random-number="randomNumber"
|
|
88
|
-
:controlled="controlled"
|
|
89
92
|
:always-system="alwaysSystem"
|
|
90
93
|
/>
|
|
91
94
|
<input
|
|
92
95
|
v-if="type !== 'textarea' && !showPassword"
|
|
93
96
|
:class="classNames(bem.e('control'), bem.em('control', 'input'))"
|
|
97
|
+
:controlled="controlled"
|
|
94
98
|
:enableNative="enableNative"
|
|
95
99
|
:value="innerValue"
|
|
96
100
|
:placeholder="placeholder"
|
|
@@ -110,6 +114,7 @@
|
|
|
110
114
|
:ignore-composition-event="ignoreCompositionEvent"
|
|
111
115
|
:inputmode="inputmode"
|
|
112
116
|
autocomplete="off"
|
|
117
|
+
:maxlength="maxLength"
|
|
113
118
|
@input="onInput"
|
|
114
119
|
@focus="onFocus"
|
|
115
120
|
@blur="onBlur"
|
|
@@ -125,7 +130,6 @@
|
|
|
125
130
|
:safe-password-salt="safePasswordSalt"
|
|
126
131
|
:safe-password-custom-hash="safePasswordCustomHash"
|
|
127
132
|
:random-number="randomNumber"
|
|
128
|
-
:controlled="controlled"
|
|
129
133
|
:always-system="alwaysSystem"
|
|
130
134
|
/>
|
|
131
135
|
<view :class="bem.e('tools')">
|
|
@@ -154,7 +158,8 @@
|
|
|
154
158
|
<slot name="addon"></slot>
|
|
155
159
|
</view>
|
|
156
160
|
<view v-if="showCount" :class="bem.e('count')">
|
|
157
|
-
{{ innerValue.length }}
|
|
161
|
+
<view v-if="maxlength === -1">{{ innerValue.length }}</view>
|
|
162
|
+
<view v-else>{{ innerValue.length }} / {{ maxlength }}</view>
|
|
158
163
|
</view>
|
|
159
164
|
</view>
|
|
160
165
|
</template>
|
|
@@ -162,7 +167,7 @@
|
|
|
162
167
|
<script>
|
|
163
168
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
164
169
|
import { computed, ref, watch } from "vue";
|
|
165
|
-
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
170
|
+
import { classNames, stringifyStyle, createBem, isWeb } from "../../utils";
|
|
166
171
|
import SarIcon from "../icon/icon.vue";
|
|
167
172
|
import { useFormContext, useFormItemContext } from "../form/common";
|
|
168
173
|
import {
|
|
@@ -317,8 +322,10 @@ export default _defineComponent({
|
|
|
317
322
|
);
|
|
318
323
|
const onInput = (event) => {
|
|
319
324
|
let value = event.detail.value;
|
|
320
|
-
if (
|
|
321
|
-
|
|
325
|
+
if (!isWeb) {
|
|
326
|
+
if (props.maxlength >= 0) {
|
|
327
|
+
value = value.slice(0, props.maxlength);
|
|
328
|
+
}
|
|
322
329
|
}
|
|
323
330
|
setInnerValue(value);
|
|
324
331
|
return value;
|
|
@@ -380,6 +387,9 @@ export default _defineComponent({
|
|
|
380
387
|
const onClick = (event) => {
|
|
381
388
|
emit("click", event);
|
|
382
389
|
};
|
|
390
|
+
const maxLength = computed(() => {
|
|
391
|
+
return isWeb ? props.maxlength : -1;
|
|
392
|
+
});
|
|
383
393
|
const isPlainText = ref(false);
|
|
384
394
|
const eyeIcon = computed(() => isPlainText.value ? "eye" : "eye-slash");
|
|
385
395
|
const onEyeClick = () => {
|
|
@@ -430,7 +440,7 @@ export default _defineComponent({
|
|
|
430
440
|
return oldValue;
|
|
431
441
|
}, set oldValue(v) {
|
|
432
442
|
oldValue = v;
|
|
433
|
-
}, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, isPlainText, eyeIcon, onEyeClick, showPassword, mergedType, mergedShowEye, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, get classNames() {
|
|
443
|
+
}, onFocus, onBlur, clearVisible, holdupClear, onClearTouchStart, onClearTouchEnd, onClearMouseDown, onClearClick, onLinechange, onConfirm, onKeyboardheightchange, onClick, maxLength, isPlainText, eyeIcon, onEyeClick, showPassword, mergedType, mergedShowEye, inputClass, inputStyle, controlStyle, mergedPlaceholderStyle, get classNames() {
|
|
434
444
|
return classNames;
|
|
435
445
|
}, SarIcon };
|
|
436
446
|
return __returned__;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
calendar: {
|
|
3
|
+
weeks: {
|
|
4
|
+
0: string;
|
|
5
|
+
1: string;
|
|
6
|
+
2: string;
|
|
7
|
+
3: string;
|
|
8
|
+
4: string;
|
|
9
|
+
5: string;
|
|
10
|
+
6: string;
|
|
11
|
+
};
|
|
12
|
+
monthTitle: string;
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
to: string;
|
|
16
|
+
multipleOutlet: string;
|
|
17
|
+
};
|
|
18
|
+
cascader: {
|
|
19
|
+
pleaseSelect: string;
|
|
20
|
+
};
|
|
21
|
+
cropImage: {
|
|
22
|
+
confirm: string;
|
|
23
|
+
cancel: string;
|
|
24
|
+
};
|
|
25
|
+
datetimePicker: {
|
|
26
|
+
y: string;
|
|
27
|
+
M: string;
|
|
28
|
+
d: string;
|
|
29
|
+
h: string;
|
|
30
|
+
m: string;
|
|
31
|
+
s: string;
|
|
32
|
+
};
|
|
33
|
+
datetimeRangePickerInput: {
|
|
34
|
+
to: string;
|
|
35
|
+
};
|
|
36
|
+
dialog: {
|
|
37
|
+
confirm: string;
|
|
38
|
+
cancel: string;
|
|
39
|
+
};
|
|
40
|
+
empty: {
|
|
41
|
+
noData: string;
|
|
42
|
+
};
|
|
43
|
+
form: {
|
|
44
|
+
defaultValidateMessages: {
|
|
45
|
+
default: string;
|
|
46
|
+
required: string;
|
|
47
|
+
enum: string;
|
|
48
|
+
whitespace: string;
|
|
49
|
+
date: {
|
|
50
|
+
format: string;
|
|
51
|
+
parse: string;
|
|
52
|
+
invalid: string;
|
|
53
|
+
};
|
|
54
|
+
types: {
|
|
55
|
+
string: string;
|
|
56
|
+
function: string;
|
|
57
|
+
array: string;
|
|
58
|
+
object: string;
|
|
59
|
+
number: string;
|
|
60
|
+
date: string;
|
|
61
|
+
boolean: string;
|
|
62
|
+
integer: string;
|
|
63
|
+
float: string;
|
|
64
|
+
regexp: string;
|
|
65
|
+
email: string;
|
|
66
|
+
url: string;
|
|
67
|
+
hex: string;
|
|
68
|
+
};
|
|
69
|
+
string: {
|
|
70
|
+
len: string;
|
|
71
|
+
min: string;
|
|
72
|
+
max: string;
|
|
73
|
+
range: string;
|
|
74
|
+
};
|
|
75
|
+
number: {
|
|
76
|
+
len: string;
|
|
77
|
+
min: string;
|
|
78
|
+
max: string;
|
|
79
|
+
range: string;
|
|
80
|
+
};
|
|
81
|
+
array: {
|
|
82
|
+
len: string;
|
|
83
|
+
min: string;
|
|
84
|
+
max: string;
|
|
85
|
+
range: string;
|
|
86
|
+
};
|
|
87
|
+
pattern: {
|
|
88
|
+
mismatch: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
loadMore: {
|
|
93
|
+
incompleteText: string;
|
|
94
|
+
loadingText: string;
|
|
95
|
+
completeText: string;
|
|
96
|
+
errorText: string;
|
|
97
|
+
};
|
|
98
|
+
pagination: {
|
|
99
|
+
previous: string;
|
|
100
|
+
next: string;
|
|
101
|
+
};
|
|
102
|
+
popout: {
|
|
103
|
+
confirm: string;
|
|
104
|
+
cancel: string;
|
|
105
|
+
};
|
|
106
|
+
readMore: {
|
|
107
|
+
fold: string;
|
|
108
|
+
unfold: string;
|
|
109
|
+
};
|
|
110
|
+
signature: {
|
|
111
|
+
confirm: string;
|
|
112
|
+
clear: string;
|
|
113
|
+
cancel: string;
|
|
114
|
+
};
|
|
115
|
+
tree: {
|
|
116
|
+
addSibling: string;
|
|
117
|
+
addChild: string;
|
|
118
|
+
addRoot: string;
|
|
119
|
+
removeNode: string;
|
|
120
|
+
edit: string;
|
|
121
|
+
please: string;
|
|
122
|
+
error: string;
|
|
123
|
+
noData: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export default _default;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
const formTypeTemplate = '${label}không phải là một ${type} hợp lệ';
|
|
2
|
+
export default {
|
|
3
|
+
calendar: {
|
|
4
|
+
weeks: {
|
|
5
|
+
0: 'CN',
|
|
6
|
+
1: 'T2',
|
|
7
|
+
2: 'T3',
|
|
8
|
+
3: 'T4',
|
|
9
|
+
4: 'T5',
|
|
10
|
+
5: 'T6',
|
|
11
|
+
6: 'T7',
|
|
12
|
+
},
|
|
13
|
+
monthTitle: 'Tháng ${month} năm ${year}',
|
|
14
|
+
start: 'Bắt đầu',
|
|
15
|
+
end: 'Kết thúc',
|
|
16
|
+
to: 'đến',
|
|
17
|
+
multipleOutlet: 'Đã chọn ${count} ngày',
|
|
18
|
+
},
|
|
19
|
+
cascader: {
|
|
20
|
+
pleaseSelect: 'Vui lòng chọn',
|
|
21
|
+
},
|
|
22
|
+
cropImage: {
|
|
23
|
+
confirm: 'Xác nhận',
|
|
24
|
+
cancel: 'Hủy',
|
|
25
|
+
},
|
|
26
|
+
datetimePicker: {
|
|
27
|
+
y: 'năm',
|
|
28
|
+
M: 'tháng',
|
|
29
|
+
d: 'ngày',
|
|
30
|
+
h: 'giờ',
|
|
31
|
+
m: 'phút',
|
|
32
|
+
s: 'giây',
|
|
33
|
+
},
|
|
34
|
+
datetimeRangePickerInput: {
|
|
35
|
+
to: 'đến',
|
|
36
|
+
},
|
|
37
|
+
dialog: {
|
|
38
|
+
confirm: 'Xác nhận',
|
|
39
|
+
cancel: 'Hủy',
|
|
40
|
+
},
|
|
41
|
+
empty: {
|
|
42
|
+
noData: 'Không có dữ liệu',
|
|
43
|
+
},
|
|
44
|
+
form: {
|
|
45
|
+
defaultValidateMessages: {
|
|
46
|
+
default: 'Lỗi xác thực trường ${label}',
|
|
47
|
+
required: '${label} là bắt buộc',
|
|
48
|
+
enum: '${label} phải là một trong [${enum}]',
|
|
49
|
+
whitespace: '${label} không được chứa khoảng trắng trống',
|
|
50
|
+
date: {
|
|
51
|
+
format: 'Định dạng ngày ${label} không hợp lệ',
|
|
52
|
+
parse: 'Không thể chuyển đổi ${label} thành ngày',
|
|
53
|
+
invalid: '${label} là một ngày không hợp lệ',
|
|
54
|
+
},
|
|
55
|
+
types: {
|
|
56
|
+
string: formTypeTemplate,
|
|
57
|
+
function: formTypeTemplate,
|
|
58
|
+
array: formTypeTemplate,
|
|
59
|
+
object: formTypeTemplate,
|
|
60
|
+
number: formTypeTemplate,
|
|
61
|
+
date: formTypeTemplate,
|
|
62
|
+
boolean: formTypeTemplate,
|
|
63
|
+
integer: formTypeTemplate,
|
|
64
|
+
float: formTypeTemplate,
|
|
65
|
+
regexp: formTypeTemplate,
|
|
66
|
+
email: formTypeTemplate,
|
|
67
|
+
url: formTypeTemplate,
|
|
68
|
+
hex: formTypeTemplate,
|
|
69
|
+
},
|
|
70
|
+
string: {
|
|
71
|
+
len: '${label} phải có ${len} ký tự',
|
|
72
|
+
min: '${label} tối thiểu ${min} ký tự',
|
|
73
|
+
max: '${label} tối đa ${max} ký tự',
|
|
74
|
+
range: '${label} phải nằm trong khoảng ${min}-${max} ký tự',
|
|
75
|
+
},
|
|
76
|
+
number: {
|
|
77
|
+
len: '${label} phải bằng ${len}',
|
|
78
|
+
min: 'Giá trị tối thiểu của ${label} là ${min}',
|
|
79
|
+
max: 'Giá trị tối đa của ${label} là ${max}',
|
|
80
|
+
range: '${label} phải nằm trong khoảng ${min}-${max}',
|
|
81
|
+
},
|
|
82
|
+
array: {
|
|
83
|
+
len: 'Phải có ${len} ${label}',
|
|
84
|
+
min: 'Tối thiểu ${min} ${label}',
|
|
85
|
+
max: 'Tối đa ${max} ${label}',
|
|
86
|
+
range: 'Số lượng ${label} phải nằm trong khoảng ${min}-${max}',
|
|
87
|
+
},
|
|
88
|
+
pattern: {
|
|
89
|
+
mismatch: '${label} không khớp với mẫu ${pattern}',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
loadMore: {
|
|
94
|
+
incompleteText: 'Nhấn để tải thêm',
|
|
95
|
+
loadingText: 'Đang tải...',
|
|
96
|
+
completeText: 'Không còn nữa',
|
|
97
|
+
errorText: 'Yêu cầu thất bại, nhấn để tải lại',
|
|
98
|
+
},
|
|
99
|
+
pagination: {
|
|
100
|
+
previous: 'Trang trước',
|
|
101
|
+
next: 'Trang sau',
|
|
102
|
+
},
|
|
103
|
+
popout: {
|
|
104
|
+
confirm: 'Xác nhận',
|
|
105
|
+
cancel: 'Hủy',
|
|
106
|
+
},
|
|
107
|
+
readMore: {
|
|
108
|
+
fold: 'Thu gọn',
|
|
109
|
+
unfold: 'Mở rộng',
|
|
110
|
+
},
|
|
111
|
+
signature: {
|
|
112
|
+
confirm: 'Xác nhận',
|
|
113
|
+
clear: 'Xóa',
|
|
114
|
+
cancel: 'Hủy',
|
|
115
|
+
},
|
|
116
|
+
tree: {
|
|
117
|
+
addSibling: 'Thêm nút kế tiếp',
|
|
118
|
+
addChild: 'Thêm nút con',
|
|
119
|
+
addRoot: 'Thêm nút gốc',
|
|
120
|
+
removeNode: 'Xóa nút',
|
|
121
|
+
edit: 'Chỉnh sửa nút',
|
|
122
|
+
please: 'Vui lòng nhập tiêu đề',
|
|
123
|
+
error: 'Yêu cầu thất bại, nhấn để tải lại',
|
|
124
|
+
noData: 'Không có dữ liệu',
|
|
125
|
+
},
|
|
126
|
+
};
|
|
@@ -39,23 +39,28 @@ import Popout from 'sard-uniapp/components/popout/popout.vue'
|
|
|
39
39
|
|
|
40
40
|
### PopoutProps
|
|
41
41
|
|
|
42
|
-
| 属性
|
|
43
|
-
|
|
|
44
|
-
| root-class
|
|
45
|
-
| root-style
|
|
46
|
-
| title
|
|
47
|
-
| show-cancel
|
|
48
|
-
| cancel-text
|
|
49
|
-
| show-confirm
|
|
50
|
-
| confirm-text
|
|
51
|
-
| show-close
|
|
52
|
-
| show-footer
|
|
53
|
-
| type
|
|
54
|
-
| visible (v-model)
|
|
55
|
-
| before-close
|
|
56
|
-
| duration
|
|
57
|
-
| overlay
|
|
58
|
-
|
|
|
42
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
43
|
+
| -------------------------------- | -------------------------------------------------------------------------------------- | -------------------- | ------- |
|
|
44
|
+
| root-class | 组件根元素类名 | string | - |
|
|
45
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
46
|
+
| title | 弹出框标题 | string | - |
|
|
47
|
+
| show-cancel | 是否显示取消按钮,适用 `loose` 类型 | boolean | false |
|
|
48
|
+
| cancel-text | 取消按钮文案 | string | '取消' |
|
|
49
|
+
| show-confirm | 是否显示确定按钮,适用 `loose` 类型 | boolean | true |
|
|
50
|
+
| confirm-text | 确定按钮文案 | string | '确定' |
|
|
51
|
+
| show-close | 是否显示关闭按钮,适用 `loose` 类型 | boolean | true |
|
|
52
|
+
| show-footer | 是否显示底部按钮 | boolean | true |
|
|
53
|
+
| type | 弹出框按钮排版方式 | 'compact' \| 'loose' | 'loose' |
|
|
54
|
+
| visible (v-model) | 是否显示弹出框 | boolean | - |
|
|
55
|
+
| before-close | 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭 | PopoutBeforeClose | - |
|
|
56
|
+
| duration | 显隐动画时长,单位 ms | number | 300 |
|
|
57
|
+
| overlay <sup>1.25.1+</sup> | 是否显示遮罩 | boolean | true |
|
|
58
|
+
| overlay-class <sup>1.25.1+</sup> | 添加到遮罩的类名 | string | - |
|
|
59
|
+
| overlay-style <sup>1.25.1+</sup> | 添加到遮罩的样式 | string | - |
|
|
60
|
+
| background <sup>1.25.1+</sup> | 遮罩背景色 | string | - |
|
|
61
|
+
| transparent <sup>1.25.1+</sup> | 透明遮罩 | boolean | false |
|
|
62
|
+
| overlay-closable | 点击遮罩是否关闭 | boolean | true |
|
|
63
|
+
| keep-render <sup>1.24.3+</sup> | 无论刚挂载还是隐藏,都始终不设置 display 为 none,一般用于内部包含计算尺寸的组件的情况 | boolean | false |
|
|
59
64
|
|
|
60
65
|
### PopoutBeforeClose
|
|
61
66
|
|
|
@@ -19,6 +19,11 @@ export interface PopoutProps {
|
|
|
19
19
|
confirmDisabled?: boolean;
|
|
20
20
|
showClose?: boolean;
|
|
21
21
|
showFooter?: boolean;
|
|
22
|
+
overlay?: boolean;
|
|
23
|
+
overlayClass?: string;
|
|
24
|
+
overlayStyle?: string;
|
|
25
|
+
background?: string;
|
|
26
|
+
transparent?: boolean;
|
|
22
27
|
overlayClosable?: boolean;
|
|
23
28
|
beforeClose?: PopoutBeforeClose;
|
|
24
29
|
keepRender?: boolean;
|
|
@@ -38,6 +43,11 @@ export declare const defaultPopoutProps: {
|
|
|
38
43
|
confirmDisabled: boolean;
|
|
39
44
|
showClose: boolean;
|
|
40
45
|
showFooter: boolean;
|
|
46
|
+
overlay: boolean;
|
|
47
|
+
overlayClass: string;
|
|
48
|
+
overlayStyle: string;
|
|
49
|
+
background: string;
|
|
50
|
+
transparent: boolean;
|
|
41
51
|
overlayClosable: boolean;
|
|
42
52
|
beforeClose: PopoutBeforeClose;
|
|
43
53
|
keepRender: boolean;
|
|
@@ -56,6 +66,11 @@ export declare const defaultPopoutProps: {
|
|
|
56
66
|
confirmDisabled: boolean;
|
|
57
67
|
showClose: boolean;
|
|
58
68
|
showFooter: boolean;
|
|
69
|
+
overlay: boolean;
|
|
70
|
+
overlayClass: string;
|
|
71
|
+
overlayStyle: string;
|
|
72
|
+
background: string;
|
|
73
|
+
transparent: boolean;
|
|
59
74
|
overlayClosable: boolean;
|
|
60
75
|
beforeClose: PopoutBeforeClose;
|
|
61
76
|
keepRender: boolean;
|
|
@@ -74,6 +89,11 @@ export declare const defaultPopoutProps: {
|
|
|
74
89
|
confirmDisabled: boolean;
|
|
75
90
|
showClose: boolean;
|
|
76
91
|
showFooter: boolean;
|
|
92
|
+
overlay: boolean;
|
|
93
|
+
overlayClass: string;
|
|
94
|
+
overlayStyle: string;
|
|
95
|
+
background: string;
|
|
96
|
+
transparent: boolean;
|
|
77
97
|
overlayClosable: boolean;
|
|
78
98
|
beforeClose: PopoutBeforeClose;
|
|
79
99
|
keepRender: boolean;
|
|
@@ -92,6 +112,11 @@ export declare const defaultPopoutProps: {
|
|
|
92
112
|
confirmDisabled: boolean;
|
|
93
113
|
showClose: boolean;
|
|
94
114
|
showFooter: boolean;
|
|
115
|
+
overlay: boolean;
|
|
116
|
+
overlayClass: string;
|
|
117
|
+
overlayStyle: string;
|
|
118
|
+
background: string;
|
|
119
|
+
transparent: boolean;
|
|
95
120
|
overlayClosable: boolean;
|
|
96
121
|
beforeClose: PopoutBeforeClose;
|
|
97
122
|
keepRender: boolean;
|
|
@@ -110,6 +135,11 @@ export declare const defaultPopoutProps: {
|
|
|
110
135
|
confirmDisabled: boolean;
|
|
111
136
|
showClose: boolean;
|
|
112
137
|
showFooter: boolean;
|
|
138
|
+
overlay: boolean;
|
|
139
|
+
overlayClass: string;
|
|
140
|
+
overlayStyle: string;
|
|
141
|
+
background: string;
|
|
142
|
+
transparent: boolean;
|
|
113
143
|
overlayClosable: boolean;
|
|
114
144
|
beforeClose: PopoutBeforeClose;
|
|
115
145
|
keepRender: boolean;
|
|
@@ -128,6 +158,11 @@ export declare const defaultPopoutProps: {
|
|
|
128
158
|
confirmDisabled: boolean;
|
|
129
159
|
showClose: boolean;
|
|
130
160
|
showFooter: boolean;
|
|
161
|
+
overlay: boolean;
|
|
162
|
+
overlayClass: string;
|
|
163
|
+
overlayStyle: string;
|
|
164
|
+
background: string;
|
|
165
|
+
transparent: boolean;
|
|
131
166
|
overlayClosable: boolean;
|
|
132
167
|
beforeClose: PopoutBeforeClose;
|
|
133
168
|
keepRender: boolean;
|
|
@@ -146,6 +181,11 @@ export declare const defaultPopoutProps: {
|
|
|
146
181
|
confirmDisabled: boolean;
|
|
147
182
|
showClose: boolean;
|
|
148
183
|
showFooter: boolean;
|
|
184
|
+
overlay: boolean;
|
|
185
|
+
overlayClass: string;
|
|
186
|
+
overlayStyle: string;
|
|
187
|
+
background: string;
|
|
188
|
+
transparent: boolean;
|
|
149
189
|
overlayClosable: boolean;
|
|
150
190
|
beforeClose: PopoutBeforeClose;
|
|
151
191
|
keepRender: boolean;
|
|
@@ -164,6 +204,11 @@ export declare const defaultPopoutProps: {
|
|
|
164
204
|
confirmDisabled: boolean;
|
|
165
205
|
showClose: boolean;
|
|
166
206
|
showFooter: boolean;
|
|
207
|
+
overlay: boolean;
|
|
208
|
+
overlayClass: string;
|
|
209
|
+
overlayStyle: string;
|
|
210
|
+
background: string;
|
|
211
|
+
transparent: boolean;
|
|
167
212
|
overlayClosable: boolean;
|
|
168
213
|
beforeClose: PopoutBeforeClose;
|
|
169
214
|
keepRender: boolean;
|
|
@@ -182,6 +227,11 @@ export declare const defaultPopoutProps: {
|
|
|
182
227
|
confirmDisabled: boolean;
|
|
183
228
|
showClose: boolean;
|
|
184
229
|
showFooter: boolean;
|
|
230
|
+
overlay: boolean;
|
|
231
|
+
overlayClass: string;
|
|
232
|
+
overlayStyle: string;
|
|
233
|
+
background: string;
|
|
234
|
+
transparent: boolean;
|
|
185
235
|
overlayClosable: boolean;
|
|
186
236
|
beforeClose: PopoutBeforeClose;
|
|
187
237
|
keepRender: boolean;
|
|
@@ -200,6 +250,11 @@ export declare const defaultPopoutProps: {
|
|
|
200
250
|
confirmDisabled: boolean;
|
|
201
251
|
showClose: boolean;
|
|
202
252
|
showFooter: boolean;
|
|
253
|
+
overlay: boolean;
|
|
254
|
+
overlayClass: string;
|
|
255
|
+
overlayStyle: string;
|
|
256
|
+
background: string;
|
|
257
|
+
transparent: boolean;
|
|
203
258
|
overlayClosable: boolean;
|
|
204
259
|
beforeClose: PopoutBeforeClose;
|
|
205
260
|
keepRender: boolean;
|
|
@@ -218,6 +273,11 @@ export declare const defaultPopoutProps: {
|
|
|
218
273
|
confirmDisabled: boolean;
|
|
219
274
|
showClose: boolean;
|
|
220
275
|
showFooter: boolean;
|
|
276
|
+
overlay: boolean;
|
|
277
|
+
overlayClass: string;
|
|
278
|
+
overlayStyle: string;
|
|
279
|
+
background: string;
|
|
280
|
+
transparent: boolean;
|
|
221
281
|
overlayClosable: boolean;
|
|
222
282
|
beforeClose: PopoutBeforeClose;
|
|
223
283
|
keepRender: boolean;
|
|
@@ -236,6 +296,11 @@ export declare const defaultPopoutProps: {
|
|
|
236
296
|
confirmDisabled: boolean;
|
|
237
297
|
showClose: boolean;
|
|
238
298
|
showFooter: boolean;
|
|
299
|
+
overlay: boolean;
|
|
300
|
+
overlayClass: string;
|
|
301
|
+
overlayStyle: string;
|
|
302
|
+
background: string;
|
|
303
|
+
transparent: boolean;
|
|
239
304
|
overlayClosable: boolean;
|
|
240
305
|
beforeClose: PopoutBeforeClose;
|
|
241
306
|
keepRender: boolean;
|
|
@@ -254,6 +319,126 @@ export declare const defaultPopoutProps: {
|
|
|
254
319
|
confirmDisabled: boolean;
|
|
255
320
|
showClose: boolean;
|
|
256
321
|
showFooter: boolean;
|
|
322
|
+
overlay: boolean;
|
|
323
|
+
overlayClass: string;
|
|
324
|
+
overlayStyle: string;
|
|
325
|
+
background: string;
|
|
326
|
+
transparent: boolean;
|
|
327
|
+
overlayClosable: boolean;
|
|
328
|
+
beforeClose: PopoutBeforeClose;
|
|
329
|
+
keepRender: boolean;
|
|
330
|
+
}) => boolean)) | undefined;
|
|
331
|
+
overlay?: (boolean | ((props: {
|
|
332
|
+
rootStyle: StyleValue;
|
|
333
|
+
rootClass: string;
|
|
334
|
+
visible: boolean;
|
|
335
|
+
duration: number;
|
|
336
|
+
title: string;
|
|
337
|
+
type: "compact" | "loose";
|
|
338
|
+
showCancel: boolean;
|
|
339
|
+
cancelText: string;
|
|
340
|
+
showConfirm: boolean;
|
|
341
|
+
confirmText: string;
|
|
342
|
+
confirmDisabled: boolean;
|
|
343
|
+
showClose: boolean;
|
|
344
|
+
showFooter: boolean;
|
|
345
|
+
overlay: boolean;
|
|
346
|
+
overlayClass: string;
|
|
347
|
+
overlayStyle: string;
|
|
348
|
+
background: string;
|
|
349
|
+
transparent: boolean;
|
|
350
|
+
overlayClosable: boolean;
|
|
351
|
+
beforeClose: PopoutBeforeClose;
|
|
352
|
+
keepRender: boolean;
|
|
353
|
+
}) => boolean)) | undefined;
|
|
354
|
+
overlayClass?: (string | ((props: {
|
|
355
|
+
rootStyle: StyleValue;
|
|
356
|
+
rootClass: string;
|
|
357
|
+
visible: boolean;
|
|
358
|
+
duration: number;
|
|
359
|
+
title: string;
|
|
360
|
+
type: "compact" | "loose";
|
|
361
|
+
showCancel: boolean;
|
|
362
|
+
cancelText: string;
|
|
363
|
+
showConfirm: boolean;
|
|
364
|
+
confirmText: string;
|
|
365
|
+
confirmDisabled: boolean;
|
|
366
|
+
showClose: boolean;
|
|
367
|
+
showFooter: boolean;
|
|
368
|
+
overlay: boolean;
|
|
369
|
+
overlayClass: string;
|
|
370
|
+
overlayStyle: string;
|
|
371
|
+
background: string;
|
|
372
|
+
transparent: boolean;
|
|
373
|
+
overlayClosable: boolean;
|
|
374
|
+
beforeClose: PopoutBeforeClose;
|
|
375
|
+
keepRender: boolean;
|
|
376
|
+
}) => string)) | undefined;
|
|
377
|
+
overlayStyle?: (string | ((props: {
|
|
378
|
+
rootStyle: StyleValue;
|
|
379
|
+
rootClass: string;
|
|
380
|
+
visible: boolean;
|
|
381
|
+
duration: number;
|
|
382
|
+
title: string;
|
|
383
|
+
type: "compact" | "loose";
|
|
384
|
+
showCancel: boolean;
|
|
385
|
+
cancelText: string;
|
|
386
|
+
showConfirm: boolean;
|
|
387
|
+
confirmText: string;
|
|
388
|
+
confirmDisabled: boolean;
|
|
389
|
+
showClose: boolean;
|
|
390
|
+
showFooter: boolean;
|
|
391
|
+
overlay: boolean;
|
|
392
|
+
overlayClass: string;
|
|
393
|
+
overlayStyle: string;
|
|
394
|
+
background: string;
|
|
395
|
+
transparent: boolean;
|
|
396
|
+
overlayClosable: boolean;
|
|
397
|
+
beforeClose: PopoutBeforeClose;
|
|
398
|
+
keepRender: boolean;
|
|
399
|
+
}) => string)) | undefined;
|
|
400
|
+
background?: (string | ((props: {
|
|
401
|
+
rootStyle: StyleValue;
|
|
402
|
+
rootClass: string;
|
|
403
|
+
visible: boolean;
|
|
404
|
+
duration: number;
|
|
405
|
+
title: string;
|
|
406
|
+
type: "compact" | "loose";
|
|
407
|
+
showCancel: boolean;
|
|
408
|
+
cancelText: string;
|
|
409
|
+
showConfirm: boolean;
|
|
410
|
+
confirmText: string;
|
|
411
|
+
confirmDisabled: boolean;
|
|
412
|
+
showClose: boolean;
|
|
413
|
+
showFooter: boolean;
|
|
414
|
+
overlay: boolean;
|
|
415
|
+
overlayClass: string;
|
|
416
|
+
overlayStyle: string;
|
|
417
|
+
background: string;
|
|
418
|
+
transparent: boolean;
|
|
419
|
+
overlayClosable: boolean;
|
|
420
|
+
beforeClose: PopoutBeforeClose;
|
|
421
|
+
keepRender: boolean;
|
|
422
|
+
}) => string)) | undefined;
|
|
423
|
+
transparent?: (boolean | ((props: {
|
|
424
|
+
rootStyle: StyleValue;
|
|
425
|
+
rootClass: string;
|
|
426
|
+
visible: boolean;
|
|
427
|
+
duration: number;
|
|
428
|
+
title: string;
|
|
429
|
+
type: "compact" | "loose";
|
|
430
|
+
showCancel: boolean;
|
|
431
|
+
cancelText: string;
|
|
432
|
+
showConfirm: boolean;
|
|
433
|
+
confirmText: string;
|
|
434
|
+
confirmDisabled: boolean;
|
|
435
|
+
showClose: boolean;
|
|
436
|
+
showFooter: boolean;
|
|
437
|
+
overlay: boolean;
|
|
438
|
+
overlayClass: string;
|
|
439
|
+
overlayStyle: string;
|
|
440
|
+
background: string;
|
|
441
|
+
transparent: boolean;
|
|
257
442
|
overlayClosable: boolean;
|
|
258
443
|
beforeClose: PopoutBeforeClose;
|
|
259
444
|
keepRender: boolean;
|
|
@@ -272,6 +457,11 @@ export declare const defaultPopoutProps: {
|
|
|
272
457
|
confirmDisabled: boolean;
|
|
273
458
|
showClose: boolean;
|
|
274
459
|
showFooter: boolean;
|
|
460
|
+
overlay: boolean;
|
|
461
|
+
overlayClass: string;
|
|
462
|
+
overlayStyle: string;
|
|
463
|
+
background: string;
|
|
464
|
+
transparent: boolean;
|
|
275
465
|
overlayClosable: boolean;
|
|
276
466
|
beforeClose: PopoutBeforeClose;
|
|
277
467
|
keepRender: boolean;
|
|
@@ -290,6 +480,11 @@ export declare const defaultPopoutProps: {
|
|
|
290
480
|
confirmDisabled: boolean;
|
|
291
481
|
showClose: boolean;
|
|
292
482
|
showFooter: boolean;
|
|
483
|
+
overlay: boolean;
|
|
484
|
+
overlayClass: string;
|
|
485
|
+
overlayStyle: string;
|
|
486
|
+
background: string;
|
|
487
|
+
transparent: boolean;
|
|
293
488
|
overlayClosable: boolean;
|
|
294
489
|
beforeClose: PopoutBeforeClose;
|
|
295
490
|
keepRender: boolean;
|
|
@@ -308,6 +503,11 @@ export declare const defaultPopoutProps: {
|
|
|
308
503
|
confirmDisabled: boolean;
|
|
309
504
|
showClose: boolean;
|
|
310
505
|
showFooter: boolean;
|
|
506
|
+
overlay: boolean;
|
|
507
|
+
overlayClass: string;
|
|
508
|
+
overlayStyle: string;
|
|
509
|
+
background: string;
|
|
510
|
+
transparent: boolean;
|
|
311
511
|
overlayClosable: boolean;
|
|
312
512
|
beforeClose: PopoutBeforeClose;
|
|
313
513
|
keepRender: boolean;
|
|
@@ -12,7 +12,12 @@ declare const __VLS_component: import("vue").DefineComponent<PopoutProps, {}, {}
|
|
|
12
12
|
type: "compact" | "loose";
|
|
13
13
|
title: string;
|
|
14
14
|
visible: boolean;
|
|
15
|
+
overlay: boolean;
|
|
15
16
|
duration: number;
|
|
17
|
+
overlayClass: string;
|
|
18
|
+
overlayStyle: string;
|
|
19
|
+
background: string;
|
|
20
|
+
transparent: boolean;
|
|
16
21
|
keepRender: boolean;
|
|
17
22
|
overlayClosable: boolean;
|
|
18
23
|
beforeClose: import("./common").PopoutBeforeClose;
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
:visible="visible"
|
|
5
5
|
:duration="duration"
|
|
6
6
|
:keep-render="keepRender"
|
|
7
|
+
:overlay="overlay"
|
|
8
|
+
:overlay-class="overlayClass"
|
|
9
|
+
:overlay-style="overlayStyle"
|
|
10
|
+
:background="background"
|
|
11
|
+
:transparent="transparent"
|
|
7
12
|
@overlay-click="onOverlayClick"
|
|
8
13
|
@before-enter="onBeforeEnter"
|
|
9
14
|
@after-leave="onAfterLeave"
|
|
@@ -151,6 +156,11 @@ import {
|
|
|
151
156
|
* @property {boolean} visible 是否显示弹出框,默认值:-。
|
|
152
157
|
* @property {PopoutBeforeClose} beforeClose 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭,默认值:-。
|
|
153
158
|
* @property {number} duration 显隐动画时长,单位 ms,默认值:300。
|
|
159
|
+
* @property {boolean} overlay 是否显示遮罩,默认值:true。
|
|
160
|
+
* @property {string} overlayClass 添加到遮罩的类名,默认值:-。
|
|
161
|
+
* @property {string} overlayStyle 添加到遮罩的样式,默认值:-。
|
|
162
|
+
* @property {string} background 遮罩背景色,默认值:-。
|
|
163
|
+
* @property {boolean} transparent 透明遮罩,默认值:false。
|
|
154
164
|
* @property {boolean} overlayClosable 点击遮罩是否关闭,默认值:true。
|
|
155
165
|
* @property {boolean} keepRender 无论刚挂载还是隐藏,都始终不设置 display 为 none,一般用于内部包含计算尺寸的组件的情况,默认值:false。
|
|
156
166
|
* @event {(visible: boolean) => void} update 显隐时触发
|
|
@@ -194,6 +204,11 @@ export default _defineComponent({
|
|
|
194
204
|
confirmDisabled: { type: Boolean, required: false },
|
|
195
205
|
showClose: { type: Boolean, required: false },
|
|
196
206
|
showFooter: { type: Boolean, required: false },
|
|
207
|
+
overlay: { type: Boolean, required: false },
|
|
208
|
+
overlayClass: { type: String, required: false },
|
|
209
|
+
overlayStyle: { type: String, required: false },
|
|
210
|
+
background: { type: String, required: false },
|
|
211
|
+
transparent: { type: Boolean, required: false },
|
|
197
212
|
overlayClosable: { type: Boolean, required: false },
|
|
198
213
|
beforeClose: { type: Function, required: false },
|
|
199
214
|
keepRender: { type: Boolean, required: false }
|
|
@@ -36,6 +36,8 @@ import Popup from 'sard-uniapp/components/popup/popup.vue'
|
|
|
36
36
|
| duration | 显隐动画时长,单位 ms | number | 300 |
|
|
37
37
|
| effect | 显隐效果 | 'slide-top' \| 'slide-right' \| 'slide-bottom' \| 'slide-left' \| 'zoom' \| 'fade' | 'fade' |
|
|
38
38
|
| overlay | 是否显示遮罩 | boolean | true |
|
|
39
|
+
| overlay-class | 添加到遮罩的类名 | string | - |
|
|
40
|
+
| overlay-style | 添加到遮罩的样式 | string | - |
|
|
39
41
|
| background | 遮罩背景色 | string | - |
|
|
40
42
|
| transparent | 透明遮罩 | boolean | false |
|
|
41
43
|
| overlay-closable <sup>1.22+</sup> | 是否在点击遮罩层后关闭 | boolean | true |
|
|
@@ -63,6 +63,8 @@ import {
|
|
|
63
63
|
* @property {number} duration 显隐动画时长,单位 ms,默认值:300。
|
|
64
64
|
* @property {'slide-top' | 'slide-right' | 'slide-bottom' | 'slide-left' | 'zoom' | 'fade'} effect 显隐效果,默认值:'fade'。
|
|
65
65
|
* @property {boolean} overlay 是否显示遮罩,默认值:true。
|
|
66
|
+
* @property {string} overlayClass 添加到遮罩的类名,默认值:-。
|
|
67
|
+
* @property {string} overlayStyle 添加到遮罩的样式,默认值:-。
|
|
66
68
|
* @property {string} background 遮罩背景色,默认值:-。
|
|
67
69
|
* @property {boolean} transparent 透明遮罩,默认值:false。
|
|
68
70
|
* @property {boolean} overlayClosable 是否在点击遮罩层后关闭,默认值:true。
|
|
@@ -101,3 +101,9 @@ import Qrcode from 'sard-uniapp/components/qrcode/qrcode.vue'
|
|
|
101
101
|
| 插槽 | 描述 | 属性 |
|
|
102
102
|
| ------- | -------------- | ---- |
|
|
103
103
|
| default | 自定义额外内容 | - |
|
|
104
|
+
|
|
105
|
+
### QrcodeEmits
|
|
106
|
+
|
|
107
|
+
| 事件 | 描述 | 类型 |
|
|
108
|
+
| -------------------------- | ------------------------------------------------ | ------------------------------ |
|
|
109
|
+
| success <sup>1.25.1+</sup> | 二维码图片绘制成功后触发,可用于获取临时文件路径 | (tempFilePath: string) => void |
|
|
@@ -2,7 +2,11 @@ import { type QrcodeProps } from './common';
|
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
default?(_: {}): any;
|
|
4
4
|
};
|
|
5
|
-
declare const __VLS_component: import("vue").DefineComponent<QrcodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<QrcodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
|
+
success: (tempFilePath: string) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<QrcodeProps> & Readonly<{
|
|
8
|
+
onSuccess?: ((tempFilePath: string) => any) | undefined;
|
|
9
|
+
}>, {
|
|
6
10
|
text: string;
|
|
7
11
|
ecl: import("./common").QrcodeECL;
|
|
8
12
|
size: string;
|
|
@@ -37,7 +37,9 @@ import {
|
|
|
37
37
|
uniqid,
|
|
38
38
|
qrcode
|
|
39
39
|
} from "../../utils";
|
|
40
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
defaultQrcodeProps
|
|
42
|
+
} from "./common";
|
|
41
43
|
/**
|
|
42
44
|
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
43
45
|
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
@@ -50,6 +52,7 @@ import { defaultQrcodeProps } from "./common";
|
|
|
50
52
|
* @property {number} quietZoneModules 安静区域模块数,默认值:2。
|
|
51
53
|
* @property {boolean} showMenuByLongpress 长按图片显示菜单(微信小程序),默认值:false。
|
|
52
54
|
* @property {string} icon 二维码中图片的地址,默认值:-。
|
|
55
|
+
* @event {(tempFilePath: string) => void} success 二维码图片绘制成功后触发,可用于获取临时文件路径
|
|
53
56
|
*/
|
|
54
57
|
export default _defineComponent({
|
|
55
58
|
...{
|
|
@@ -73,9 +76,11 @@ export default _defineComponent({
|
|
|
73
76
|
showMenuByLongpress: { type: Boolean, required: false },
|
|
74
77
|
icon: { type: String, required: false }
|
|
75
78
|
}, defaultQrcodeProps),
|
|
76
|
-
|
|
79
|
+
emits: ["success"],
|
|
80
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
77
81
|
__expose();
|
|
78
82
|
const props = __props;
|
|
83
|
+
const emit = __emit;
|
|
79
84
|
const bem = createBem("qrcode");
|
|
80
85
|
const instance = getCurrentInstance();
|
|
81
86
|
const canvasId = uniqid();
|
|
@@ -124,6 +129,7 @@ export default _defineComponent({
|
|
|
124
129
|
canvasId,
|
|
125
130
|
success(res) {
|
|
126
131
|
dataURL.value = res.tempFilePath;
|
|
132
|
+
emit("success", res.tempFilePath);
|
|
127
133
|
},
|
|
128
134
|
fail(err) {
|
|
129
135
|
console.log("uni.canvasToTempFilePath fail", err);
|
|
@@ -184,7 +190,7 @@ export default _defineComponent({
|
|
|
184
190
|
height: props.size
|
|
185
191
|
});
|
|
186
192
|
});
|
|
187
|
-
const __returned__ = { props, bem, instance, canvasId, contextRef, qrcodeMap, dataURL, drawQrcode, drawIcon, loadIcon, qrcodeClass, qrcodeStyle };
|
|
193
|
+
const __returned__ = { props, emit, bem, instance, canvasId, contextRef, qrcodeMap, dataURL, drawQrcode, drawIcon, loadIcon, qrcodeClass, qrcodeStyle };
|
|
188
194
|
return __returned__;
|
|
189
195
|
}
|
|
190
196
|
});
|
|
@@ -94,6 +94,8 @@ import {
|
|
|
94
94
|
* @property {number} duration 显隐动画时长,单位 ms,默认值:300。
|
|
95
95
|
* @property {'slide-top' | 'slide-right' | 'slide-bottom' | 'slide-left' | 'zoom' | 'fade'} effect 显隐效果,默认值:'fade'。
|
|
96
96
|
* @property {boolean} overlay 是否显示遮罩,默认值:true。
|
|
97
|
+
* @property {string} overlayClass 添加到遮罩的类名,默认值:-。
|
|
98
|
+
* @property {string} overlayStyle 添加到遮罩的样式,默认值:-。
|
|
97
99
|
* @property {string} background 遮罩背景色,默认值:-。
|
|
98
100
|
* @property {boolean} transparent 透明遮罩,默认值:false。
|
|
99
101
|
* @property {boolean} overlayClosable 点击遮罩后是否关闭,默认值:true。
|