@tarojs/components 3.4.0 → 3.4.3
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-input-core.cjs.entry.js +25 -16
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +12 -3
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +3 -2
- package/dist/collection/components/input/input.js +40 -22
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +11 -2
- package/dist/collection/components/pull-to-refresh/style/index.css +1 -0
- package/dist/collection/components/scroll-view/scroll-view.js +3 -3
- package/dist/collection/components/tabbar/style/index.css +3 -1
- package/dist/collection/components/tabbar/tabbar.js +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-input-core.entry.js +25 -16
- package/dist/esm/taro-pull-to-refresh.entry.js +12 -3
- package/dist/esm/taro-scroll-view-core.entry.js +3 -3
- package/dist/esm/taro-tabbar.entry.js +3 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/taro-components/p-2b0d5c90.system.entry.js +1 -0
- package/dist/taro-components/p-33ee636a.system.js +1 -1
- package/dist/taro-components/p-4e54216b.entry.js +1 -0
- package/dist/taro-components/p-5ae86835.system.entry.js +1 -0
- package/dist/taro-components/{p-dd34408a.entry.js → p-6de12779.entry.js} +1 -1
- package/dist/taro-components/p-71e14298.entry.js +1 -0
- package/dist/taro-components/p-8486c251.system.entry.js +1 -0
- package/dist/taro-components/{p-6965567d.entry.js → p-cc818a13.entry.js} +1 -1
- package/dist/taro-components/{p-13c1404f.system.entry.js → p-fd0d1168.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +3 -3
- package/dist/types/components.d.ts +1 -0
- package/dist-h5/vue/components/picker.js +2 -1
- package/package.json +4 -4
- package/types/Ad.d.ts +22 -10
- package/types/Audio.d.ts +25 -5
- package/types/Button.d.ts +112 -23
- package/types/Camera.d.ts +11 -11
- package/types/Canvas.d.ts +14 -1
- package/types/Checkbox.d.ts +65 -1
- package/types/CoverImage.d.ts +48 -6
- package/types/CoverView.d.ts +51 -8
- package/types/Editor.d.ts +57 -0
- package/types/Form.d.ts +33 -2
- package/types/FunctionalPageNavigator.d.ts +4 -4
- package/types/Icon.d.ts +17 -1
- package/types/Image.d.ts +24 -4
- package/types/Input.d.ts +66 -5
- package/types/KeyboardAccessory.d.ts +2 -1
- package/types/Label.d.ts +18 -4
- package/types/LivePlayer.d.ts +17 -11
- package/types/LivePusher.d.ts +21 -15
- package/types/Map.d.ts +59 -5
- package/types/MatchMedia.d.ts +24 -5
- package/types/MovableArea.d.ts +9 -3
- package/types/MovableView.d.ts +20 -6
- package/types/Navigator.d.ts +7 -7
- package/types/OfficialAccount.d.ts +4 -10
- package/types/OpenData.d.ts +11 -5
- package/types/PageContainer.d.ts +12 -6
- package/types/Picker.d.ts +66 -3
- package/types/PickerView.d.ts +66 -2
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +12 -1
- package/types/Radio.d.ts +77 -1
- package/types/RichText.d.ts +33 -1
- package/types/ScrollView.d.ts +91 -9
- package/types/ShareElement.d.ts +1 -1
- package/types/Slider.d.ts +14 -1
- package/types/Swiper.d.ts +26 -1
- package/types/SwiperItem.d.ts +28 -3
- package/types/Switch.d.ts +21 -3
- package/types/Text.d.ts +38 -1
- package/types/Textarea.d.ts +17 -1
- package/types/Video.d.ts +50 -30
- package/types/View.d.ts +33 -1
- package/types/VoipRoom.d.ts +10 -11
- package/types/WebView.d.ts +7 -1
- package/types/common.d.ts +1 -1
- package/dist/taro-components/p-04818461.system.entry.js +0 -1
- package/dist/taro-components/p-56618f09.entry.js +0 -1
- package/dist/taro-components/p-665e8461.system.entry.js +0 -1
- package/dist/taro-components/p-6fcaadc7.entry.js +0 -1
- package/dist/taro-components/p-bb0d4567.system.entry.js +0 -1
package/types/Button.d.ts
CHANGED
|
@@ -4,48 +4,48 @@ import { StyleProp, ViewStyle } from 'react-native'
|
|
|
4
4
|
|
|
5
5
|
interface ButtonProps extends StandardProps {
|
|
6
6
|
/** 按钮的大小
|
|
7
|
-
* @supported weapp, h5, rn
|
|
7
|
+
* @supported weapp, h5, rn, alipay
|
|
8
8
|
* @default default
|
|
9
9
|
*/
|
|
10
|
-
size?: keyof ButtonProps.
|
|
10
|
+
size?: keyof ButtonProps.Size
|
|
11
11
|
|
|
12
12
|
/** 按钮的样式类型
|
|
13
|
-
* @supported weapp, h5, rn
|
|
13
|
+
* @supported weapp, h5, rn, alipay
|
|
14
14
|
* @default default
|
|
15
15
|
*/
|
|
16
|
-
type?: keyof ButtonProps.
|
|
16
|
+
type?: keyof ButtonProps.Type
|
|
17
17
|
|
|
18
18
|
/** 按钮是否镂空,背景色透明
|
|
19
|
-
* @supported weapp, h5, rn
|
|
19
|
+
* @supported weapp, h5, rn, alipay
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
plain?: boolean
|
|
23
23
|
|
|
24
24
|
/** 是否禁用
|
|
25
|
-
* @supported weapp, h5, rn
|
|
25
|
+
* @supported weapp, h5, rn, alipay
|
|
26
26
|
* @default false
|
|
27
27
|
*/
|
|
28
28
|
disabled?: boolean
|
|
29
29
|
|
|
30
30
|
/** 名称前是否带 loading 图标
|
|
31
|
-
* @supported weapp, h5, rn
|
|
31
|
+
* @supported weapp, h5, rn, alipay
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
34
34
|
loading?: boolean
|
|
35
35
|
|
|
36
36
|
/** 用于 `<form/>` 组件,点击分别会触发 `<form/>` 组件的 submit/reset 事件
|
|
37
|
-
* @supported weapp
|
|
37
|
+
* @supported weapp, alipay
|
|
38
38
|
*/
|
|
39
|
-
formType?: keyof ButtonProps.
|
|
39
|
+
formType?: keyof ButtonProps.FormType
|
|
40
40
|
|
|
41
41
|
/** 微信开放能力
|
|
42
42
|
* @supported weapp, alipay, qq
|
|
43
43
|
*/
|
|
44
|
-
openType?: ButtonProps.
|
|
44
|
+
openType?: ButtonProps.OpenType
|
|
45
45
|
|
|
46
46
|
/** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
|
|
47
47
|
* @default button-hover
|
|
48
|
-
* @supported weapp, h5
|
|
48
|
+
* @supported weapp, alipay, h5
|
|
49
49
|
* @rn 支持 hoverStyle 属性,但框架未支持 hoverClass
|
|
50
50
|
*/
|
|
51
51
|
hoverClass?: string
|
|
@@ -58,19 +58,19 @@ interface ButtonProps extends StandardProps {
|
|
|
58
58
|
|
|
59
59
|
/** 指定是否阻止本节点的祖先节点出现点击态
|
|
60
60
|
* @default false
|
|
61
|
-
* @supported weapp
|
|
61
|
+
* @supported weapp, alipay
|
|
62
62
|
*/
|
|
63
63
|
hoverStopPropagation?: boolean
|
|
64
64
|
|
|
65
65
|
/** 按住后多久出现点击态,单位毫秒
|
|
66
66
|
* @default 20
|
|
67
|
-
* @supported weapp, h5, rn
|
|
67
|
+
* @supported weapp, alipay, h5, rn
|
|
68
68
|
*/
|
|
69
69
|
hoverStartTime?: number
|
|
70
70
|
|
|
71
71
|
/** 手指松开后点击态保留时间,单位毫秒
|
|
72
72
|
* @default 70
|
|
73
|
-
* @supported weapp, h5, rn
|
|
73
|
+
* @supported weapp, alipay, h5, rn
|
|
74
74
|
*/
|
|
75
75
|
hoverStayTime?: number
|
|
76
76
|
|
|
@@ -79,7 +79,7 @@ interface ButtonProps extends StandardProps {
|
|
|
79
79
|
* 生效时机: `open-type="getUserInfo"`
|
|
80
80
|
* @supported weapp
|
|
81
81
|
*/
|
|
82
|
-
lang?: keyof ButtonProps.
|
|
82
|
+
lang?: keyof ButtonProps.Lang
|
|
83
83
|
|
|
84
84
|
/** 会话来源
|
|
85
85
|
*
|
|
@@ -168,6 +168,13 @@ interface ButtonProps extends StandardProps {
|
|
|
168
168
|
*/
|
|
169
169
|
onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
|
|
170
170
|
|
|
171
|
+
/** 获取头像信息
|
|
172
|
+
*
|
|
173
|
+
* 生效时机:`open-type="chooseavatar"`
|
|
174
|
+
* @supported weapp
|
|
175
|
+
*/
|
|
176
|
+
onChooseAvatar?: CommonEventFunction<ButtonProps.onChooseAvatarEventDetail>
|
|
177
|
+
|
|
171
178
|
/** 获取用户实名
|
|
172
179
|
*
|
|
173
180
|
* 生效时机:`open-type="getRealnameAuthInfo"`
|
|
@@ -199,14 +206,14 @@ interface ButtonProps extends StandardProps {
|
|
|
199
206
|
|
|
200
207
|
declare namespace ButtonProps {
|
|
201
208
|
/** size 的合法值 */
|
|
202
|
-
interface
|
|
209
|
+
interface Size {
|
|
203
210
|
/** 默认大小 */
|
|
204
211
|
default
|
|
205
212
|
/** 小尺寸 */
|
|
206
213
|
mini
|
|
207
214
|
}
|
|
208
215
|
/** type 的合法值 */
|
|
209
|
-
interface
|
|
216
|
+
interface Type {
|
|
210
217
|
/** 绿色 */
|
|
211
218
|
primary
|
|
212
219
|
/** 白色 */
|
|
@@ -215,14 +222,14 @@ declare namespace ButtonProps {
|
|
|
215
222
|
warn
|
|
216
223
|
}
|
|
217
224
|
/** form-type 的合法值 */
|
|
218
|
-
interface
|
|
225
|
+
interface FormType {
|
|
219
226
|
/** 提交表单 */
|
|
220
227
|
submit
|
|
221
228
|
/** 重置表单 */
|
|
222
229
|
reset
|
|
223
230
|
}
|
|
224
231
|
/** open-type 的合法值 */
|
|
225
|
-
type
|
|
232
|
+
type OpenType = keyof openTypeKeys["weapp"] | keyof openTypeKeys["alipay"] | keyof openTypeKeys["qq"]
|
|
226
233
|
/** open-type 的合法值 */
|
|
227
234
|
interface openTypeKeys {
|
|
228
235
|
weapp: {
|
|
@@ -238,6 +245,10 @@ declare namespace ButtonProps {
|
|
|
238
245
|
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
|
|
239
246
|
*/
|
|
240
247
|
getPhoneNumber
|
|
248
|
+
/** 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息
|
|
249
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html
|
|
250
|
+
*/
|
|
251
|
+
chooseAvatar
|
|
241
252
|
/** 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 */
|
|
242
253
|
getUserInfo
|
|
243
254
|
/** 用户实名信息授权,已经弃用 */
|
|
@@ -297,7 +308,7 @@ declare namespace ButtonProps {
|
|
|
297
308
|
}
|
|
298
309
|
}
|
|
299
310
|
/** lang 的合法值 */
|
|
300
|
-
interface
|
|
311
|
+
interface Lang {
|
|
301
312
|
/** 英文 */
|
|
302
313
|
en
|
|
303
314
|
/** 简体中文 */
|
|
@@ -313,7 +324,7 @@ declare namespace ButtonProps {
|
|
|
313
324
|
/** 头像 */
|
|
314
325
|
avatarUrl: string
|
|
315
326
|
/** 性别 */
|
|
316
|
-
gender: keyof
|
|
327
|
+
gender: keyof Gender
|
|
317
328
|
/** 省份,如:`Yunnan` */
|
|
318
329
|
province: string
|
|
319
330
|
/** 城市,如:`Dalian` */
|
|
@@ -336,7 +347,7 @@ declare namespace ButtonProps {
|
|
|
336
347
|
}
|
|
337
348
|
|
|
338
349
|
/** 性别的合法值 */
|
|
339
|
-
interface
|
|
350
|
+
interface Gender {
|
|
340
351
|
/** 未知 */
|
|
341
352
|
0
|
|
342
353
|
/** 男 */
|
|
@@ -363,6 +374,11 @@ declare namespace ButtonProps {
|
|
|
363
374
|
iv: string
|
|
364
375
|
}
|
|
365
376
|
|
|
377
|
+
interface onChooseAvatarEventDetail {
|
|
378
|
+
/* 获取用户头像的临时链接 */
|
|
379
|
+
avatarUrl: string
|
|
380
|
+
}
|
|
381
|
+
|
|
366
382
|
interface onOpenSettingEventDetail {
|
|
367
383
|
/* 打开授权设置页的调用状态 */
|
|
368
384
|
errMsg: string
|
|
@@ -374,7 +390,7 @@ declare namespace ButtonProps {
|
|
|
374
390
|
/** 按钮
|
|
375
391
|
* @classification forms
|
|
376
392
|
* @supported weapp, h5, rn
|
|
377
|
-
* @
|
|
393
|
+
* @example_react
|
|
378
394
|
* ```tsx
|
|
379
395
|
* export default class PageButton extends Component {
|
|
380
396
|
* state = {
|
|
@@ -447,6 +463,79 @@ declare namespace ButtonProps {
|
|
|
447
463
|
* }
|
|
448
464
|
* }
|
|
449
465
|
* ```
|
|
466
|
+
* @example_vue
|
|
467
|
+
* ```html
|
|
468
|
+
* <template>
|
|
469
|
+
* <view class="container">
|
|
470
|
+
* <button
|
|
471
|
+
* v-for="item in btn"
|
|
472
|
+
* :size="item.size ? item.size : ''"
|
|
473
|
+
* :type="item.type ? item.type : ''"
|
|
474
|
+
* :loading="item.loading ? item.loading : false"
|
|
475
|
+
* :disabled="item.disabled ? item.disabled : false"
|
|
476
|
+
* >
|
|
477
|
+
* {{ item.text }}
|
|
478
|
+
* </button>
|
|
479
|
+
* <button class="btn-max-w" :plain="true" type="primary">按钮</button>
|
|
480
|
+
* <button class="btn-max-w" :plain="true" type="primary" :disabled="true">不可点击的按钮</button>
|
|
481
|
+
* <button class="btn-max-w" :plain="true">按钮</button>
|
|
482
|
+
* <button class="btn-max-w" :plain="true" :disabled="true">按钮</button>
|
|
483
|
+
* <button size="mini" type="primary">按钮</button>
|
|
484
|
+
* <button size="mini" >按钮</button>
|
|
485
|
+
* <button size="mini" type="warn">按钮</button>
|
|
486
|
+
* </view>
|
|
487
|
+
* </template>
|
|
488
|
+
*
|
|
489
|
+
* <script>
|
|
490
|
+
* export default {
|
|
491
|
+
* data() {
|
|
492
|
+
* return {
|
|
493
|
+
* btn: [
|
|
494
|
+
* {
|
|
495
|
+
* text: '页面主操作 Normal',
|
|
496
|
+
* size: 'default',
|
|
497
|
+
* type: 'primary'
|
|
498
|
+
* },
|
|
499
|
+
* {
|
|
500
|
+
* text: '页面主操作 Loading',
|
|
501
|
+
* size: 'default',
|
|
502
|
+
* type: 'primary',
|
|
503
|
+
* loading: true,
|
|
504
|
+
* },
|
|
505
|
+
* {
|
|
506
|
+
* text: '页面主操作 Disabled',
|
|
507
|
+
* size: 'default',
|
|
508
|
+
* type: 'primary',
|
|
509
|
+
* disabled: true,
|
|
510
|
+
* },
|
|
511
|
+
* {
|
|
512
|
+
* text: '页面次要操作 Normal',
|
|
513
|
+
* size: 'default',
|
|
514
|
+
* type: 'default'
|
|
515
|
+
* },
|
|
516
|
+
* {
|
|
517
|
+
* text: '页面次要操作 Disabled',
|
|
518
|
+
* size: 'default',
|
|
519
|
+
* type: 'default',
|
|
520
|
+
* disabled: true,
|
|
521
|
+
* },
|
|
522
|
+
* {
|
|
523
|
+
* text: '警告类操作 Normal',
|
|
524
|
+
* size: 'default',
|
|
525
|
+
* type: 'warn'
|
|
526
|
+
* },
|
|
527
|
+
* {
|
|
528
|
+
* text: '警告类操作 Disabled',
|
|
529
|
+
* size: 'default',
|
|
530
|
+
* type: 'warn',
|
|
531
|
+
* disabled: true,
|
|
532
|
+
* }
|
|
533
|
+
* ]
|
|
534
|
+
* }
|
|
535
|
+
* }
|
|
536
|
+
* }
|
|
537
|
+
* </script>
|
|
538
|
+
* ```
|
|
450
539
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/button.html
|
|
451
540
|
*/
|
|
452
541
|
declare const Button: ComponentType<ButtonProps>
|
package/types/Camera.d.ts
CHANGED
|
@@ -6,31 +6,31 @@ interface CameraProps extends StandardProps {
|
|
|
6
6
|
* @default "normal"
|
|
7
7
|
* @supported weapp, rn
|
|
8
8
|
*/
|
|
9
|
-
mode?: keyof CameraProps.
|
|
9
|
+
mode?: keyof CameraProps.Mode
|
|
10
10
|
|
|
11
11
|
/** 分辨率,不支持动态修改
|
|
12
12
|
* @default "medium"
|
|
13
13
|
* @supported weapp
|
|
14
14
|
*/
|
|
15
|
-
resolution?: keyof CameraProps.
|
|
15
|
+
resolution?: keyof CameraProps.Resolution
|
|
16
16
|
|
|
17
17
|
/** 摄像头朝向
|
|
18
18
|
* @default "back"
|
|
19
19
|
* @supported weapp, rn
|
|
20
20
|
*/
|
|
21
|
-
devicePosition?: keyof CameraProps.
|
|
21
|
+
devicePosition?: keyof CameraProps.DevicePosition
|
|
22
22
|
|
|
23
23
|
/** 闪光灯
|
|
24
24
|
* @default "auto"
|
|
25
25
|
* @supported weapp, rn
|
|
26
26
|
*/
|
|
27
|
-
flash?: keyof CameraProps.
|
|
27
|
+
flash?: keyof CameraProps.Flash
|
|
28
28
|
|
|
29
29
|
/** 指定期望的相机帧数据尺寸
|
|
30
30
|
* @default "medium"
|
|
31
31
|
* @supported weapp
|
|
32
32
|
*/
|
|
33
|
-
frameSize?: keyof CameraProps.
|
|
33
|
+
frameSize?: keyof CameraProps.FrameSize
|
|
34
34
|
|
|
35
35
|
/** 扫码识别区域,格式为[x, y, w, h],
|
|
36
36
|
* x,y是相对于camera显示区域的左上角,
|
|
@@ -64,14 +64,14 @@ interface CameraProps extends StandardProps {
|
|
|
64
64
|
|
|
65
65
|
declare namespace CameraProps {
|
|
66
66
|
/** mode 的合法值 */
|
|
67
|
-
interface
|
|
67
|
+
interface Mode {
|
|
68
68
|
/** 相机模式 */
|
|
69
69
|
normal
|
|
70
70
|
/** 扫码模式 */
|
|
71
71
|
scanCode
|
|
72
72
|
}
|
|
73
73
|
/** resolution 的合法值 */
|
|
74
|
-
interface
|
|
74
|
+
interface Resolution {
|
|
75
75
|
/** 低 */
|
|
76
76
|
low
|
|
77
77
|
/** 中 */
|
|
@@ -80,14 +80,14 @@ declare namespace CameraProps {
|
|
|
80
80
|
high
|
|
81
81
|
}
|
|
82
82
|
/** device-position 的合法值 */
|
|
83
|
-
interface
|
|
83
|
+
interface DevicePosition {
|
|
84
84
|
/** 前置 */
|
|
85
85
|
front
|
|
86
86
|
/** 后置 */
|
|
87
87
|
back
|
|
88
88
|
}
|
|
89
89
|
/** flash 的合法值 */
|
|
90
|
-
interface
|
|
90
|
+
interface Flash {
|
|
91
91
|
/** 自动 */
|
|
92
92
|
auto
|
|
93
93
|
/** 打开 */
|
|
@@ -98,7 +98,7 @@ declare namespace CameraProps {
|
|
|
98
98
|
torch
|
|
99
99
|
}
|
|
100
100
|
/** frame-size 的合法值 */
|
|
101
|
-
interface
|
|
101
|
+
interface FrameSize {
|
|
102
102
|
/** 小尺寸帧数据 */
|
|
103
103
|
small
|
|
104
104
|
/** 中尺寸帧数据 */
|
|
@@ -115,7 +115,7 @@ declare namespace CameraProps {
|
|
|
115
115
|
|
|
116
116
|
/** 系统相机
|
|
117
117
|
* @classification media
|
|
118
|
-
* @supported weapp
|
|
118
|
+
* @supported weapp, rn
|
|
119
119
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/camera.html
|
|
120
120
|
*/
|
|
121
121
|
declare const Camera: ComponentType<CameraProps>
|
package/types/Canvas.d.ts
CHANGED
|
@@ -47,6 +47,11 @@ interface CanvasProps extends StandardProps<any, CanvasTouchEvent> {
|
|
|
47
47
|
* @supported weapp
|
|
48
48
|
*/
|
|
49
49
|
onError?: CommonEventFunction<CanvasProps.onErrorEventDetail>
|
|
50
|
+
|
|
51
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
52
|
+
* @supported h5
|
|
53
|
+
*/
|
|
54
|
+
nativeProps?: Record<string, unknown>
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
declare namespace CanvasProps {
|
|
@@ -60,16 +65,24 @@ declare namespace CanvasProps {
|
|
|
60
65
|
* `<Canvas />` 组件的 RN 版本尚未实现。
|
|
61
66
|
* @classification canvas
|
|
62
67
|
* @supported weapp
|
|
63
|
-
* @
|
|
68
|
+
* @example_react
|
|
64
69
|
* ```tsx
|
|
65
70
|
* class App extends Components {
|
|
66
71
|
* render () {
|
|
72
|
+
* // 如果是支付宝小程序,则要加上 id 属性,值和canvasId一致
|
|
67
73
|
* return (
|
|
68
74
|
* <Canvas style='width: 300px; height: 200px;' canvasId='canvas' />
|
|
69
75
|
* )
|
|
70
76
|
* }
|
|
71
77
|
* }
|
|
72
78
|
* ```
|
|
79
|
+
* @example_vue
|
|
80
|
+
* ```html
|
|
81
|
+
* <template>
|
|
82
|
+
* <!-- 如果是支付宝小程序,则要加上 id 属性,值和canvasId一致 -->
|
|
83
|
+
* <canvas style="width: 300px; height: 200px;" canvas-id="canvas" />
|
|
84
|
+
* </template>
|
|
85
|
+
* ```
|
|
73
86
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html
|
|
74
87
|
*/
|
|
75
88
|
declare const Canvas: ComponentType<CanvasProps>
|
package/types/Checkbox.d.ts
CHANGED
|
@@ -29,12 +29,17 @@ interface CheckboxProps extends StandardProps {
|
|
|
29
29
|
* @supported h5, rn
|
|
30
30
|
*/
|
|
31
31
|
onChange?: CommonEventFunction<{ value: string[] }>
|
|
32
|
+
|
|
33
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
34
|
+
* @supported h5
|
|
35
|
+
*/
|
|
36
|
+
nativeProps?: Record<string, unknown>
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/** 多选项目
|
|
35
40
|
* @classification forms
|
|
36
41
|
* @supported weapp, h5, rn
|
|
37
|
-
* @
|
|
42
|
+
* @example_react
|
|
38
43
|
* ```tsx
|
|
39
44
|
* export default class PageCheckbox extends Component {
|
|
40
45
|
* state = {
|
|
@@ -94,6 +99,65 @@ interface CheckboxProps extends StandardProps {
|
|
|
94
99
|
* }
|
|
95
100
|
* }
|
|
96
101
|
* ```
|
|
102
|
+
* @example_vue
|
|
103
|
+
* ```html
|
|
104
|
+
* <template>
|
|
105
|
+
* <view class="container">
|
|
106
|
+
* <view class="page-section">
|
|
107
|
+
* <text>默认样式</text>
|
|
108
|
+
* <checkbox value="选中" :checked="true">选中</checkbox>
|
|
109
|
+
* <checkbox style="margin-left: 20rpx;" value="未选中">未选中</checkbox>
|
|
110
|
+
* </view>
|
|
111
|
+
* <view class="page-section">
|
|
112
|
+
* <text>推荐展示样式(Taro 团队成员):</text>
|
|
113
|
+
* <label v-for="item in list" class="checkbox-list__label">
|
|
114
|
+
* <checkbox class="checkbox-list__checkbox" :value="item.value" :checked="item.checked">{{ item.text }}</checkbox>
|
|
115
|
+
* </label>
|
|
116
|
+
* </view>
|
|
117
|
+
* </view>
|
|
118
|
+
* </template>
|
|
119
|
+
*
|
|
120
|
+
* <script>
|
|
121
|
+
* export default {
|
|
122
|
+
* data() {
|
|
123
|
+
* return {
|
|
124
|
+
* list: [
|
|
125
|
+
* {
|
|
126
|
+
* value: '美国',
|
|
127
|
+
* text: '美国',
|
|
128
|
+
* checked: false
|
|
129
|
+
* },
|
|
130
|
+
* {
|
|
131
|
+
* value: '中国',
|
|
132
|
+
* text: '中国',
|
|
133
|
+
* checked: true
|
|
134
|
+
* },
|
|
135
|
+
* {
|
|
136
|
+
* value: '巴西',
|
|
137
|
+
* text: '巴西',
|
|
138
|
+
* checked: false
|
|
139
|
+
* },
|
|
140
|
+
* {
|
|
141
|
+
* value: '日本',
|
|
142
|
+
* text: '日本',
|
|
143
|
+
* checked: false
|
|
144
|
+
* },
|
|
145
|
+
* {
|
|
146
|
+
* value: '英国',
|
|
147
|
+
* text: '英国',
|
|
148
|
+
* checked: false
|
|
149
|
+
* },
|
|
150
|
+
* {
|
|
151
|
+
* value: '法国',
|
|
152
|
+
* text: '法国',
|
|
153
|
+
* checked: false
|
|
154
|
+
* }
|
|
155
|
+
* ]
|
|
156
|
+
* }
|
|
157
|
+
* }
|
|
158
|
+
* }
|
|
159
|
+
* </script>
|
|
160
|
+
* ```
|
|
97
161
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/checkbox.html
|
|
98
162
|
*/
|
|
99
163
|
declare const Checkbox: ComponentType<CheckboxProps>
|
package/types/CoverImage.d.ts
CHANGED
|
@@ -3,32 +3,34 @@ import { StandardProps, CommonEventFunction } from './common'
|
|
|
3
3
|
|
|
4
4
|
interface CoverImageProps extends StandardProps {
|
|
5
5
|
/** 图标路径,支持临时路径、网络地址、云文件ID。暂不支持base64格式。
|
|
6
|
-
* @supported weapp
|
|
6
|
+
* @supported weapp, h5
|
|
7
7
|
*/
|
|
8
8
|
src: string
|
|
9
9
|
|
|
10
10
|
/** 图片加载成功时触发
|
|
11
|
-
* @supported weapp
|
|
11
|
+
* @supported weapp, h5
|
|
12
12
|
*/
|
|
13
13
|
onLoad?: CommonEventFunction
|
|
14
14
|
|
|
15
15
|
/** 图片加载失败时触发
|
|
16
|
-
* @supported weapp
|
|
16
|
+
* @supported weapp, h5
|
|
17
17
|
*/
|
|
18
18
|
onError?: CommonEventFunction
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/** 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。
|
|
22
22
|
* @classification viewContainer
|
|
23
|
-
* @supported weapp, swan, alipay
|
|
24
|
-
* @
|
|
23
|
+
* @supported weapp, swan, alipay, h5
|
|
24
|
+
* @example_react
|
|
25
25
|
* ```tsx
|
|
26
|
+
* // js
|
|
26
27
|
* class App extends Components {
|
|
27
28
|
* render () {
|
|
28
29
|
* return (
|
|
30
|
+
* <View className='container'>
|
|
29
31
|
* <Video id='myVideo' src='src'>
|
|
30
32
|
* <CoverView className='controls'>
|
|
31
|
-
* <CoverView className='play' onClick=
|
|
33
|
+
* <CoverView className='play' onClick='play'>
|
|
32
34
|
* <CoverImage className='img' src='src' />
|
|
33
35
|
* </CoverView>
|
|
34
36
|
* </CoverView>
|
|
@@ -36,6 +38,46 @@ interface CoverImageProps extends StandardProps {
|
|
|
36
38
|
* )
|
|
37
39
|
* }
|
|
38
40
|
* }
|
|
41
|
+
* // css
|
|
42
|
+
* .container {
|
|
43
|
+
* position: relative;
|
|
44
|
+
* }
|
|
45
|
+
* .controls {
|
|
46
|
+
* position: absolute;
|
|
47
|
+
* top: 50%;
|
|
48
|
+
* left: 50%;
|
|
49
|
+
* width: 300px;
|
|
50
|
+
* height: 225px;
|
|
51
|
+
* transform: translate(-50%, -50%);
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
* @example_vue
|
|
55
|
+
* ```html
|
|
56
|
+
* <template>
|
|
57
|
+
* <view class="container">
|
|
58
|
+
* <video id='myvideo' src='https://ugccsy.qq.com/uwMROfz2r5zBIaQXGdGnC2dfDma3J1MItM3912IN4IRQvkRM/o31507f7lcd.mp4?sdtfrom=v1010&guid=aa18cf106b7fdb7e40f2d20b206f2b4f&vkey=63B0FCCC7FC3ADC342C166D86571AE02772258CD9B515B065DC68DF3919D8C288AE831D570ED5E8FE0FF3E81E170D04FF11F874BFDDACF7AAA2C0CFF2ACB39FB1A94DAD1AB859BDA53E4DD6DBCDC1217CEF789A9AC079924E2BBC599EED7A1FFDD60A727F2EB7E7B6472CE63DD4B683C9199DFC78A6A6C4D9891E05467C4B64E'>
|
|
59
|
+
* </video>
|
|
60
|
+
* <cover-view class='controls'>
|
|
61
|
+
* <cover-view class='play' `@tap='play'>
|
|
62
|
+
* <cover-image class='img' src='https://img10.360buyimg.com/ling/s345x208_jfs/t1/133501/7/9865/382161/5f5ee31fEbdd6a418/0cdc0156ffff3c23.png' />
|
|
63
|
+
* </cover-view>
|
|
64
|
+
* </cover-view>
|
|
65
|
+
* </view>
|
|
66
|
+
* </template>
|
|
67
|
+
*
|
|
68
|
+
* <style>
|
|
69
|
+
* .container {
|
|
70
|
+
* position: relative;
|
|
71
|
+
* }
|
|
72
|
+
* .controls {
|
|
73
|
+
* position: absolute;
|
|
74
|
+
* top: 50%;
|
|
75
|
+
* left: 50%;
|
|
76
|
+
* width: 300px;
|
|
77
|
+
* height: 225px;
|
|
78
|
+
* transform: translate(-50%, -50%);
|
|
79
|
+
* }
|
|
80
|
+
* </style>
|
|
39
81
|
* ```
|
|
40
82
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/cover-image.html
|
|
41
83
|
*/
|
package/types/CoverView.d.ts
CHANGED
|
@@ -21,22 +21,65 @@ interface CoverViewProps extends ViewProps {
|
|
|
21
21
|
|
|
22
22
|
/** 覆盖在原生组件之上的文本视图。可覆盖的原生组件包括 map、video、canvas、camera、live-player、live-pusher 只支持嵌套 cover-view、cover-image,可在 cover-view 中使用 button。
|
|
23
23
|
* @classification viewContainer
|
|
24
|
-
* @supported weapp, swan, alipay
|
|
25
|
-
* @
|
|
24
|
+
* @supported weapp, swan, alipay, h5
|
|
25
|
+
* @example_react
|
|
26
26
|
* ```tsx
|
|
27
|
+
* // js
|
|
27
28
|
* class App extends Components {
|
|
28
29
|
* render () {
|
|
29
30
|
* return (
|
|
30
|
-
* <
|
|
31
|
-
* <
|
|
32
|
-
* <CoverView className='
|
|
33
|
-
* <
|
|
31
|
+
* <View className='container'>
|
|
32
|
+
* <Video id='myVideo' src='src'>
|
|
33
|
+
* <CoverView className='controls'>
|
|
34
|
+
* <CoverView className='play' onClick='play'>
|
|
35
|
+
* <CoverImage className='img' src='src' />
|
|
36
|
+
* </CoverView>
|
|
34
37
|
* </CoverView>
|
|
35
|
-
* </
|
|
36
|
-
* </
|
|
38
|
+
* </Video>
|
|
39
|
+
* </View>
|
|
37
40
|
* )
|
|
38
41
|
* }
|
|
39
42
|
* }
|
|
43
|
+
* // css
|
|
44
|
+
* .container {
|
|
45
|
+
* position: relative;
|
|
46
|
+
* }
|
|
47
|
+
* .controls {
|
|
48
|
+
* position: absolute;
|
|
49
|
+
* top: 50%;
|
|
50
|
+
* left: 50%;
|
|
51
|
+
* width: 300px;
|
|
52
|
+
* height: 225px;
|
|
53
|
+
* transform: translate(-50%, -50%);
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
* @example_vue
|
|
57
|
+
* ```html
|
|
58
|
+
* <template>
|
|
59
|
+
* <view class="container">
|
|
60
|
+
* <video id='myvideo' src='https://ugccsy.qq.com/uwMROfz2r5zBIaQXGdGnC2dfDma3J1MItM3912IN4IRQvkRM/o31507f7lcd.mp4?sdtfrom=v1010&guid=aa18cf106b7fdb7e40f2d20b206f2b4f&vkey=63B0FCCC7FC3ADC342C166D86571AE02772258CD9B515B065DC68DF3919D8C288AE831D570ED5E8FE0FF3E81E170D04FF11F874BFDDACF7AAA2C0CFF2ACB39FB1A94DAD1AB859BDA53E4DD6DBCDC1217CEF789A9AC079924E2BBC599EED7A1FFDD60A727F2EB7E7B6472CE63DD4B683C9199DFC78A6A6C4D9891E05467C4B64E'>
|
|
61
|
+
* </video>
|
|
62
|
+
* <cover-view class='controls'>
|
|
63
|
+
* <cover-view class='play' `@tap='play'>
|
|
64
|
+
* <cover-image class='img' src='https://img10.360buyimg.com/ling/s345x208_jfs/t1/133501/7/9865/382161/5f5ee31fEbdd6a418/0cdc0156ffff3c23.png' />
|
|
65
|
+
* </cover-view>
|
|
66
|
+
* </cover-view>
|
|
67
|
+
* </view>
|
|
68
|
+
* </template>
|
|
69
|
+
*
|
|
70
|
+
* <style>
|
|
71
|
+
* .container {
|
|
72
|
+
* position: relative;
|
|
73
|
+
* }
|
|
74
|
+
* .controls {
|
|
75
|
+
* position: absolute;
|
|
76
|
+
* top: 50%;
|
|
77
|
+
* left: 50%;
|
|
78
|
+
* width: 300px;
|
|
79
|
+
* height: 225px;
|
|
80
|
+
* transform: translate(-50%, -50%);
|
|
81
|
+
* }
|
|
82
|
+
* </style>
|
|
40
83
|
* ```
|
|
41
84
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html
|
|
42
85
|
*/
|