@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.
Files changed (88) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/taro-components.cjs.js +1 -1
  3. package/dist/cjs/taro-input-core.cjs.entry.js +25 -16
  4. package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +12 -3
  5. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
  6. package/dist/cjs/taro-tabbar.cjs.entry.js +3 -2
  7. package/dist/collection/components/input/input.js +40 -22
  8. package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +11 -2
  9. package/dist/collection/components/pull-to-refresh/style/index.css +1 -0
  10. package/dist/collection/components/scroll-view/scroll-view.js +3 -3
  11. package/dist/collection/components/tabbar/style/index.css +3 -1
  12. package/dist/collection/components/tabbar/tabbar.js +2 -1
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm/taro-components.js +1 -1
  15. package/dist/esm/taro-input-core.entry.js +25 -16
  16. package/dist/esm/taro-pull-to-refresh.entry.js +12 -3
  17. package/dist/esm/taro-scroll-view-core.entry.js +3 -3
  18. package/dist/esm/taro-tabbar.entry.js +3 -2
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/taro-components.js +1 -1
  21. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  22. package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
  23. package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
  24. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  25. package/dist/taro-components/p-2b0d5c90.system.entry.js +1 -0
  26. package/dist/taro-components/p-33ee636a.system.js +1 -1
  27. package/dist/taro-components/p-4e54216b.entry.js +1 -0
  28. package/dist/taro-components/p-5ae86835.system.entry.js +1 -0
  29. package/dist/taro-components/{p-dd34408a.entry.js → p-6de12779.entry.js} +1 -1
  30. package/dist/taro-components/p-71e14298.entry.js +1 -0
  31. package/dist/taro-components/p-8486c251.system.entry.js +1 -0
  32. package/dist/taro-components/{p-6965567d.entry.js → p-cc818a13.entry.js} +1 -1
  33. package/dist/taro-components/{p-13c1404f.system.entry.js → p-fd0d1168.system.entry.js} +1 -1
  34. package/dist/taro-components/taro-components.esm.js +1 -1
  35. package/dist/types/components/input/input.d.ts +3 -3
  36. package/dist/types/components.d.ts +1 -0
  37. package/dist-h5/vue/components/picker.js +2 -1
  38. package/package.json +4 -4
  39. package/types/Ad.d.ts +22 -10
  40. package/types/Audio.d.ts +25 -5
  41. package/types/Button.d.ts +112 -23
  42. package/types/Camera.d.ts +11 -11
  43. package/types/Canvas.d.ts +14 -1
  44. package/types/Checkbox.d.ts +65 -1
  45. package/types/CoverImage.d.ts +48 -6
  46. package/types/CoverView.d.ts +51 -8
  47. package/types/Editor.d.ts +57 -0
  48. package/types/Form.d.ts +33 -2
  49. package/types/FunctionalPageNavigator.d.ts +4 -4
  50. package/types/Icon.d.ts +17 -1
  51. package/types/Image.d.ts +24 -4
  52. package/types/Input.d.ts +66 -5
  53. package/types/KeyboardAccessory.d.ts +2 -1
  54. package/types/Label.d.ts +18 -4
  55. package/types/LivePlayer.d.ts +17 -11
  56. package/types/LivePusher.d.ts +21 -15
  57. package/types/Map.d.ts +59 -5
  58. package/types/MatchMedia.d.ts +24 -5
  59. package/types/MovableArea.d.ts +9 -3
  60. package/types/MovableView.d.ts +20 -6
  61. package/types/Navigator.d.ts +7 -7
  62. package/types/OfficialAccount.d.ts +4 -10
  63. package/types/OpenData.d.ts +11 -5
  64. package/types/PageContainer.d.ts +12 -6
  65. package/types/Picker.d.ts +66 -3
  66. package/types/PickerView.d.ts +66 -2
  67. package/types/PickerViewColumn.d.ts +1 -1
  68. package/types/Progress.d.ts +12 -1
  69. package/types/Radio.d.ts +77 -1
  70. package/types/RichText.d.ts +33 -1
  71. package/types/ScrollView.d.ts +91 -9
  72. package/types/ShareElement.d.ts +1 -1
  73. package/types/Slider.d.ts +14 -1
  74. package/types/Swiper.d.ts +26 -1
  75. package/types/SwiperItem.d.ts +28 -3
  76. package/types/Switch.d.ts +21 -3
  77. package/types/Text.d.ts +38 -1
  78. package/types/Textarea.d.ts +17 -1
  79. package/types/Video.d.ts +50 -30
  80. package/types/View.d.ts +33 -1
  81. package/types/VoipRoom.d.ts +10 -11
  82. package/types/WebView.d.ts +7 -1
  83. package/types/common.d.ts +1 -1
  84. package/dist/taro-components/p-04818461.system.entry.js +0 -1
  85. package/dist/taro-components/p-56618f09.entry.js +0 -1
  86. package/dist/taro-components/p-665e8461.system.entry.js +0 -1
  87. package/dist/taro-components/p-6fcaadc7.entry.js +0 -1
  88. package/dist/taro-components/p-bb0d4567.system.entry.js +0 -1
package/types/Map.d.ts CHANGED
@@ -499,14 +499,14 @@ declare namespace MapProps {
499
499
  end
500
500
  }
501
501
 
502
- interface causedByBegin {
502
+ interface CausedByBegin {
503
503
  /** 手势触发 */
504
504
  gesture
505
505
  /** 接口触发 */
506
506
  update
507
507
  }
508
508
 
509
- interface causedByEnd {
509
+ interface CausedByEnd {
510
510
  /** 拖动导致 */
511
511
  drag
512
512
  /** 缩放导致 */
@@ -523,7 +523,7 @@ declare namespace MapProps {
523
523
  /** 导致视野变化的原因
524
524
  * @remarks 有效值为 gesture(手势触发)、update(接口触发或调用更新接口导致)、drag(拖动导致)、scale(缩放导致)
525
525
  */
526
- causedBy: keyof (T extends 'begin' ? RegionChangeDetail.causedByBegin : RegionChangeDetail.causedByEnd)
526
+ causedBy: keyof (T extends 'begin' ? RegionChangeDetail.CausedByBegin : RegionChangeDetail.CausedByEnd)
527
527
  /** 视野改变详情 */
528
528
  detail: regionChangeDetail<RegionChangeDetail.type>
529
529
  }
@@ -532,7 +532,7 @@ declare namespace MapProps {
532
532
  rotate: number
533
533
  /** 倾斜角度 */
534
534
  skew: number
535
- causedBy: keyof (T extends 'begin' ? RegionChangeDetail.causedByBegin : RegionChangeDetail.causedByEnd)
535
+ causedBy: keyof (T extends 'begin' ? RegionChangeDetail.CausedByBegin : RegionChangeDetail.CausedByEnd)
536
536
  type: T | string
537
537
  scale: number
538
538
  centerLocation: point
@@ -551,7 +551,7 @@ declare namespace MapProps {
551
551
  /** 地图。相关api Taro.createMapContext。
552
552
  * @classification maps
553
553
  * @supported weapp, alipay, swan
554
- * @example
554
+ * @example_react
555
555
  * ```tsx
556
556
  * class App extends Component {
557
557
  * onTap () {}
@@ -562,6 +562,60 @@ declare namespace MapProps {
562
562
  * }
563
563
  * }
564
564
  * ```
565
+ * @example_vue
566
+ * ```html
567
+ * <template>
568
+ * <map
569
+ * id="map"
570
+ * style="width: 100%; height: 300px;"
571
+ * longitude="113.324520"
572
+ * latitude="23.099994"
573
+ * scale="14"
574
+ * :markers="markers"
575
+ * :polyline="polyline"
576
+ * :show-location="true"
577
+ * `@regionchange="regionchange"
578
+ * `@markertap="markertap"
579
+ * />
580
+ * </template>
581
+ *
582
+ * <script>
583
+ * export default {
584
+ * data() {
585
+ * return {
586
+ * markers: [{
587
+ * iconPath: "https://avatars2.githubusercontent.com/u/1782542?s=460&u=d20514a52100ed1f82282bcfca6f49052793c889&v=4",
588
+ * id: 0,
589
+ * latitude: 23.099994,
590
+ * longitude: 113.324520,
591
+ * width: 50,
592
+ * height: 50
593
+ * }],
594
+ * polyline: [{
595
+ * points: [{
596
+ * longitude: 113.3245211,
597
+ * latitude: 23.10229
598
+ * }, {
599
+ * longitude: 113.324520,
600
+ * latitude: 23.21229
601
+ * }],
602
+ * color:"#FF0000DD",
603
+ * width: 2,
604
+ * dottedLine: true
605
+ * }]
606
+ * }
607
+ * },
608
+ * methods: {
609
+ * regionchange(e) {
610
+ * console.log(e.type)
611
+ * },
612
+ * markertap(e) {
613
+ * console.log("markertap:", e.detail.markerId)
614
+ * }
615
+ * }
616
+ * }
617
+ * </script>
618
+ * ```
565
619
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/map.html#map
566
620
  */
567
621
  declare const Map: ComponentType<MapProps>
@@ -40,20 +40,39 @@ interface MatchMediaProps extends StandardProps {
40
40
 
41
41
  /** media query 匹配检测节点。可以指定一组 media query 规则,满足时,这个节点才会被展示。
42
42
  * 通过这个节点可以实现“页面宽高在某个范围时才展示某个区域”这样的效果。
43
- * 基础库 2.11.1 开始支持。
44
43
  * @supported weapp
45
- * @example
44
+ * @classification viewContainer
45
+ * @example_react
46
46
  * ```tsx
47
47
  * class App extends Components {
48
48
  * render () {
49
49
  * return (
50
- * <MatchMedia minWidth='400'>
51
- <View>title</View>
52
- </MatchMedia>
50
+ * <View>
51
+ * <MatchMedia minWidth="300" maxWidth="600">
52
+ * <view>当页面宽度在 300 ~ 500 px 之间时展示这里</view>
53
+ * </MatchMedia>
54
+ * <MatchMedia minHeight="400" orientation="landscape">
55
+ * <view>当页面高度不小于 400 px 且屏幕方向为纵向时展示这里</view>
56
+ * </MatchMedia>
57
+ * </View>
53
58
  * )
54
59
  * }
55
60
  * }
56
61
  * ```
62
+ * @example_vue
63
+ * ```html
64
+ * <template>
65
+ * <view class="components-page">
66
+ * <match-media min-width="300" max-width="500">
67
+ * <view>当页面宽度在 300 ~ 500 px 之间时展示这里</view>
68
+ * </match-media>
69
+ * <match-media min-height="400" orientation="landscape">
70
+ * <view>当页面高度不小于 400 px 且屏幕方向为纵向时展示这里</view>
71
+ * </match-media>
72
+ * </view>
73
+ * </template>
74
+ * ```
75
+ * @see https://developers.weixin.qq.com/miniprogram/dev/component/match-media.html
57
76
  */
58
77
  declare const MatchMedia: ComponentType<MatchMediaProps>
59
78
 
@@ -11,19 +11,25 @@ interface MovableAreaProps extends StandardProps {
11
11
 
12
12
  /** movable-view 的可移动区域
13
13
  * @classification viewContainer
14
- * @supported weapp
15
- * @example
14
+ * @supported weapp, rn
15
+ * @example_react
16
16
  * ```tsx
17
17
  * class App extends Components {
18
18
  * render () {
19
19
  * return (
20
20
  * <MovableArea style='height: 200px; width: 200px; background: red;'>
21
- * <MovableView style='height: 50px; width: 50px; background: blue;' direction='all'></MovableView>
21
+ * <MovableView style='height: 50px; width: 50px; background: blue;' direction='all'>旅行的意义</MovableView>
22
22
  * </MovableArea>
23
23
  * )
24
24
  * }
25
25
  * }
26
26
  * ```
27
+ * @example_vue
28
+ * ```html
29
+ * <movable-area style='height: 200px; width: 200px; background: red;'>
30
+ * <movable-view style='height: 50px; width: 50px; background: blue;' direction='all'>在路上</movable-view>
31
+ * </movable-area>
32
+ * ```
27
33
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/movable-area.html
28
34
  */
29
35
  declare const MovableArea: ComponentType<MovableAreaProps>
@@ -4,7 +4,7 @@ import { StandardProps, CommonEventFunction, TouchEventFunction } from './common
4
4
  interface MovableViewProps extends Omit<StandardProps, 'animation'> {
5
5
  /** movable-view 的移动方向,属性值有`all`、`vertical`、`horizontal`、`none`
6
6
  * @default none
7
- * @supported weapp
7
+ * @supported weapp, rn
8
8
  */
9
9
  direction?: 'all' | 'vertical' | 'horizontal' | 'none'
10
10
 
@@ -21,12 +21,12 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
21
21
  outOfBounds?: boolean
22
22
 
23
23
  /** 定义 x 轴方向的偏移,如果 x 的值不在可移动范围内,会自动移动到可移动范围;改变 x 的值会触发动画
24
- * @supported weapp
24
+ * @supported weapp, rn
25
25
  */
26
26
  x?: number | string
27
27
 
28
28
  /** 定义 y 轴方向的偏移,如果 y 的值不在可移动范围内,会自动移动到可移动范围;改变 y 的值会触发动画
29
- * @supported weapp
29
+ * @supported weapp, rn
30
30
  */
31
31
  y?: number | string
32
32
 
@@ -44,7 +44,7 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
44
44
 
45
45
  /** 是否禁用
46
46
  * @default false
47
- * @supported weapp
47
+ * @supported weapp, rn
48
48
  */
49
49
  disabled?: boolean
50
50
 
@@ -97,6 +97,14 @@ interface MovableViewProps extends Omit<StandardProps, 'animation'> {
97
97
  * @supported weapp
98
98
  */
99
99
  onVTouchMove?: TouchEventFunction
100
+ /** 开始拖动时触发
101
+ * @supported rn
102
+ */
103
+ onDragStart?: CommonEventFunction
104
+ /** 拖动结束时触发
105
+ * @supported rn
106
+ */
107
+ onDragEnd?: CommonEventFunction
100
108
  }
101
109
 
102
110
  declare namespace MovableViewProps {
@@ -135,8 +143,8 @@ declare namespace MovableViewProps {
135
143
 
136
144
  /** 可移动的视图容器,在页面中可以拖拽滑动。movable-view 必须在 movable-area 组件中,并且必须是直接子节点,否则不能移动。
137
145
  * @classification viewContainer
138
- * @supported weapp, swan, alipay
139
- * @example
146
+ * @supported weapp, swan, alipay, rn
147
+ * @example_react
140
148
  * ```tsx
141
149
  * class App extends Components {
142
150
  * render () {
@@ -148,6 +156,12 @@ declare namespace MovableViewProps {
148
156
  * }
149
157
  * }
150
158
  * ```
159
+ * @example_vue
160
+ * ```html
161
+ * <movable-area style='height: 200px; width: 200px; background: red;'>
162
+ * <movable-view style='height: 50px; width: 50px; background: blue;' direction='all'>带我走</movable-view>
163
+ * </movable-area>
164
+ * ```
151
165
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/movable-view.html
152
166
  */
153
167
  declare const MovableView: ComponentType<MovableViewProps>
@@ -6,7 +6,7 @@ interface NavigatorProps extends StandardProps {
6
6
  * @default "self"
7
7
  * @supported weapp, swan
8
8
  */
9
- target?: keyof NavigatorProps.target
9
+ target?: keyof NavigatorProps.Target
10
10
 
11
11
  /** 当前小程序内的跳转链接
12
12
  * @supported weapp, swan, alipay, tt
@@ -17,7 +17,7 @@ interface NavigatorProps extends StandardProps {
17
17
  * @default "navigate"
18
18
  * @supported weapp, swan, alipay, tt
19
19
  */
20
- openType?: keyof NavigatorProps.openType
20
+ openType?: keyof NavigatorProps.OpenType
21
21
 
22
22
  /** 当 open-type 为 'navigateBack' 时有效,表示回退的层数
23
23
  * @supported weapp, swan, tt
@@ -42,7 +42,7 @@ interface NavigatorProps extends StandardProps {
42
42
  /** 当 `target="miniProgram"` 时有效,要打开的小程序版本
43
43
  * @supported weapp, swan
44
44
  */
45
- version?: keyof NavigatorProps.version
45
+ version?: keyof NavigatorProps.Version
46
46
 
47
47
  /** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
48
48
  * @default "navigator-hover"
@@ -86,17 +86,17 @@ interface NavigatorProps extends StandardProps {
86
86
 
87
87
  declare namespace NavigatorProps {
88
88
  /** target 的合法值 */
89
- interface target {
89
+ interface Target {
90
90
  /** 当前小程序 */
91
91
  self
92
92
  /** 其它小程序 */
93
93
  miniProgram
94
94
  }
95
95
  /** open-type 的合法值 */
96
- interface openType {
96
+ interface OpenType {
97
97
  /** 对应 Taro.navigateTo 或 Taro.navigateToMiniProgram 的功能 */
98
98
  navigate
99
- /** 对应 Taro.redirectTo 的功能 */
99
+ /** 对应 Taro.redirectTo 的功能 */
100
100
  redirect
101
101
  /** 对应 Taro.switchTab 的功能 */
102
102
  switchTab
@@ -108,7 +108,7 @@ declare namespace NavigatorProps {
108
108
  exit
109
109
  }
110
110
  /** version 的合法值 */
111
- interface version {
111
+ interface Version {
112
112
  /** 开发版 */
113
113
  develop
114
114
  /** 体验版 */
@@ -5,24 +5,24 @@ interface OfficialAccountProps extends StandardProps {
5
5
  /** 组件加载成功时触发
6
6
  * @supported weapp
7
7
  */
8
- onLoad?: CommonEventFunction<OfficialAccountProps.detail>
8
+ onLoad?: CommonEventFunction<OfficialAccountProps.Detail>
9
9
 
10
10
  /** 组件加载失败时触发
11
11
  * @supported weapp
12
12
  */
13
- onError?: CommonEventFunction<OfficialAccountProps.detail>
13
+ onError?: CommonEventFunction<OfficialAccountProps.Detail>
14
14
  }
15
15
 
16
16
  declare namespace OfficialAccountProps {
17
17
  /** detail 对象 */
18
- interface detail {
18
+ interface Detail {
19
19
  /** 状态码 */
20
20
  status: number
21
21
  /** 错误信息 */
22
22
  errMsg: string
23
23
  }
24
24
  /** status 有效值 */
25
- interface status {
25
+ interface Status {
26
26
  /** 网络错误 */
27
27
  '-2'
28
28
  /** 数据解析错误 */
@@ -54,12 +54,6 @@ declare namespace OfficialAccountProps {
54
54
  * 当小程序从扫小程序码场景(场景值1047,场景值1124)打开时
55
55
  * 当小程序从聊天顶部场景(场景值1089)中的「最近使用」内打开时,若小程序之前未被销毁,则该组件保持上一次打开小程序时的状态
56
56
  * 当从其他小程序返回小程序(场景值1038)时,若小程序之前未被销毁,则该组件保持上一次打开小程序时的状态
57
- * 为便于开发者调试,基础库 2.7.3 版本起开发版小程序增加以下场景展示公众号组件:
58
- *
59
- * 开发版小程序从扫二维码(场景值 1011)打开 — 体验版小程序打开
60
- * 组件限定最小宽度为 300px,高度为定值 84px。
61
- *
62
- * 每个页面只能配置一个该组件。
63
57
  * @classification open
64
58
  * @supported weapp
65
59
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html
@@ -5,7 +5,7 @@ interface OpenDataProps extends StandardProps {
5
5
  /** 开放数据类型
6
6
  * @supported weapp
7
7
  */
8
- type: keyof OpenDataProps.type
8
+ type: keyof OpenDataProps.Type
9
9
  /** 当 type="groupName" 时生效, 群id
10
10
  * @supported weapp
11
11
  */
@@ -14,7 +14,7 @@ interface OpenDataProps extends StandardProps {
14
14
  * @default "en"
15
15
  * @supported weapp
16
16
  */
17
- lang?: keyof OpenDataProps.lang
17
+ lang?: keyof OpenDataProps.Lang
18
18
 
19
19
  /** 数据为空时的默认文案
20
20
  * @supported weapp
@@ -34,7 +34,7 @@ interface OpenDataProps extends StandardProps {
34
34
 
35
35
  declare namespace OpenDataProps {
36
36
  /** type 的合法值 */
37
- interface type {
37
+ interface Type {
38
38
  /** 拉取群名称 */
39
39
  groupName
40
40
  /** 用户昵称 */
@@ -53,7 +53,7 @@ declare namespace OpenDataProps {
53
53
  userLanguage
54
54
  }
55
55
  /** lang 的合法值 */
56
- interface lang {
56
+ interface Lang {
57
57
  /** 英文 */
58
58
  en
59
59
  /** 简体中文 */
@@ -66,7 +66,7 @@ declare namespace OpenDataProps {
66
66
  /** 用于展示微信开放的数据
67
67
  * @classification open
68
68
  * @supported weapp
69
- * @example
69
+ * @example_react
70
70
  * ```tsx
71
71
  * class App extends Component {
72
72
  * render () {
@@ -76,6 +76,12 @@ declare namespace OpenDataProps {
76
76
  * }
77
77
  * }
78
78
  * ```
79
+ * @example_vue
80
+ * ```html
81
+ * <template>
82
+ * <open-data type="userAvatarUrl" />
83
+ * </template>
84
+ * ```
79
85
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html
80
86
  */
81
87
  declare const OpenData: ComponentType<OpenDataProps>
@@ -30,7 +30,7 @@ interface PageContainerProps extends StandardProps {
30
30
  * @default bottom
31
31
  * @supported weapp
32
32
  */
33
- position?: keyof PageContainerProps.position
33
+ position?: keyof PageContainerProps.Position
34
34
 
35
35
  /** 是否显示圆角
36
36
  * @default false
@@ -38,21 +38,21 @@ interface PageContainerProps extends StandardProps {
38
38
  */
39
39
  round?: boolean
40
40
 
41
- /** 自定义遮罩层样式
41
+ /** 是否在下滑一段距离后关闭
42
42
  * @default false
43
43
  * @supported weapp
44
44
  */
45
45
  closeOnSlideDown?: boolean
46
46
 
47
- /** 是否在下滑一段距离后关闭
47
+ /** 自定义遮罩层样式
48
48
  * @supported weapp
49
49
  */
50
- overlayStyle?: boolean
50
+ overlayStyle?: string
51
51
 
52
52
  /** 自定义弹出层样式
53
53
  * @supported weapp
54
54
  */
55
- customStyle?: boolean
55
+ customStyle?: string
56
56
 
57
57
  /** 进入前触发
58
58
  * @supported weapp
@@ -91,10 +91,15 @@ interface PageContainerProps extends StandardProps {
91
91
  }
92
92
 
93
93
  declare namespace PageContainerProps {
94
- interface position {
94
+ /** 弹出位置 */
95
+ interface Position {
96
+ /** 上方弹出 */
95
97
  top
98
+ /** 下方弹出 */
96
99
  bottom
100
+ /** 左边弹出 */
97
101
  left
102
+ /** 右边弹出 */
98
103
  right
99
104
  }
100
105
  }
@@ -108,6 +113,7 @@ declare namespace PageContainerProps {
108
113
  * 1. tip: 当前页面最多只有 1 个容器,若已存在容器的情况下,无法增加新的容器
109
114
  * 2. tip: wx.navigateBack 无法在页面栈顶调用,此时没有上一级页面
110
115
  * @classification viewContainer
116
+ * @supported weapp
111
117
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html
112
118
  */
113
119
  declare const PageContainer: ComponentType<PageContainerProps>
package/types/Picker.d.ts CHANGED
@@ -103,7 +103,7 @@ interface PickerMultiSelectorProps extends PickerStandardProps {
103
103
  * 列改变时触发
104
104
  * @supported weapp, h5, rn
105
105
  */
106
- onColumnChange?: CommonEventFunction<PickerMultiSelectorProps.ColumnChangeEvnetDetail>
106
+ onColumnChange?: CommonEventFunction<PickerMultiSelectorProps.ColumnChangeEventDetail>
107
107
  }
108
108
 
109
109
  declare namespace PickerMultiSelectorProps {
@@ -111,7 +111,7 @@ declare namespace PickerMultiSelectorProps {
111
111
  /** 表示变更值的下标 */
112
112
  value: number[]
113
113
  }
114
- interface ColumnChangeEvnetDetail {
114
+ interface ColumnChangeEventDetail {
115
115
  /** 表示改变了第几列(下标从0开始) */
116
116
  column: number
117
117
  /** 表示变更值的下标 */
@@ -247,7 +247,7 @@ declare namespace PickerRegionProps {
247
247
  * 从底部弹起的滚动选择器
248
248
  * @classification forms
249
249
  * @supported weapp, h5, rn, swan, alipay, tt
250
- * @example
250
+ * @example_react
251
251
  * ```tsx
252
252
  * export default class PagePicker extends Component {
253
253
  * state = {
@@ -314,6 +314,69 @@ declare namespace PickerRegionProps {
314
314
  * }
315
315
  * }
316
316
  * ```
317
+ * @example_vue
318
+ * ```html
319
+ * <template>
320
+ * <view class="page-body">
321
+ * <view class="page-section">
322
+ * <text>地区选择器</text>
323
+ * <view>
324
+ * <picker mode="selector" :range="selector" `@change="onChange">
325
+ * <view class="picker">
326
+ * 当前选择:{{selectorChecked}}
327
+ * </view>
328
+ * </picker>
329
+ * </view>
330
+ * </view>
331
+ * <view class="page-section">
332
+ * <text>时间选择器</text>
333
+ * <view>
334
+ * <picker mode="time" `@change="onTimeChange">
335
+ * <view class="picker">
336
+ * 当前选择:{{timeSel}}
337
+ * </view>
338
+ * </picker>
339
+ * </view>
340
+ * </view>
341
+ * <view class="page-section">
342
+ * <text>日期选择器</text>
343
+ * <view>
344
+ * <picker mode="date" `@change="onDateChange">
345
+ * <view class="picker">
346
+ * 当前选择:{{dateSel}}
347
+ * </view>
348
+ * </picker>
349
+ * </view>
350
+ * </view>
351
+ * </view>
352
+ * </template>
353
+ *
354
+ * <script>
355
+ * export default {
356
+ * data() {
357
+ * return {
358
+ * selector: ['美国', '中国', '巴西', '日本'],
359
+ * selectorChecked: '美国',
360
+ * timeSel: '12:01',
361
+ * dateSel: '2018-04-22'
362
+ * }
363
+ * },
364
+ * methods: {
365
+ * onChange: function(e) {
366
+ * this.selectorChecked = this.selector[e.detail.value]
367
+ * },
368
+ *
369
+ * onTimeChange: function(e) {
370
+ * this.timeSel = e.detail.value
371
+ * },
372
+ *
373
+ * onDateChange: function(e) {
374
+ * this.dateSel = e.detail.value
375
+ * }
376
+ * }
377
+ * }
378
+ * </script>
379
+ * ```
317
380
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/picker.html
318
381
  */
319
382
  declare const Picker: ComponentType<PickerMultiSelectorProps | PickerTimeProps | PickerDateProps | PickerRegionProps | PickerSelectorProps>
@@ -28,6 +28,12 @@ interface PickerViewProps extends StandardProps {
28
28
  */
29
29
  maskClass?: string
30
30
 
31
+ /** 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件。
32
+ * @supported weapp
33
+ * @default false
34
+ */
35
+ immediateChange?: boolean
36
+
31
37
  /** 当滚动选择,value 改变时触发 change 事件,event.detail = {value: value};value为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0 开始)
32
38
  * @supported weapp, swan, alipay, tt, rn
33
39
  */
@@ -53,8 +59,8 @@ declare namespace PickerViewProps {
53
59
  /** 嵌入页面的滚动选择器
54
60
  * 其中只可放置 picker-view-column 组件,其它节点不会显示
55
61
  * @classification forms
56
- * @supported weapp, swan, alipay, tt
57
- * @example
62
+ * @supported weapp, swan, alipay, tt, h5, rn
63
+ * @example_react
58
64
  * ```tsx
59
65
  * export default class Picks extends Component {
60
66
  *
@@ -125,7 +131,65 @@ declare namespace PickerViewProps {
125
131
  * )
126
132
  * }
127
133
  * }
134
+ * ```
135
+ * @example_vue
136
+ * ```html
137
+ * <template>
138
+ * <view class="taro-example">
139
+ * <view>{{year}}年{{month}}月{{day}}日</view>
140
+ * <picker-view indicator-style="height: 30px;" style="width: 100%; height: 300px;" :value="value" `@change="onChange">
141
+ * <picker-view-column>
142
+ * <view v-for="(item, index) in years" :key="index">{{item}}年</view>
143
+ * </picker-view-column>
144
+ * <picker-view-column>
145
+ * <view v-for="(item, index) in months" :key="index">{{item}}月</view>
146
+ * </picker-view-column>
147
+ * <picker-view-column>
148
+ * <view v-for="(item, index) in days" :key="index">{{item}}日</view>
149
+ * </picker-view-column>
150
+ * </picker-view>
151
+ * </view>
152
+ * </template>
128
153
  *
154
+ * <script>
155
+ * export default {
156
+ * name: "Index",
157
+ * data() {
158
+ * const date = new Date()
159
+ * const years = []
160
+ * const months = []
161
+ * const days = []
162
+ * for (let i = 1990; i <= date.getFullYear(); i++) {
163
+ * years.push(i)
164
+ * }
165
+ * for (let i = 1; i <= 12; i++) {
166
+ * months.push(i)
167
+ * }
168
+ * for (let i = 1; i <= 31; i++) {
169
+ * days.push(i)
170
+ * }
171
+ * return {
172
+ * years: years,
173
+ * year: date.getFullYear(),
174
+ * months: months,
175
+ * month: 2,
176
+ * days: days,
177
+ * day: 2,
178
+ * value: [3, 1, 1]
179
+ * }
180
+ * },
181
+ *
182
+ * methods: {
183
+ * onChange: function(e) {
184
+ * const val = e.detail.value
185
+ * console.log(val)
186
+ * this.year = this.years[val[0]]
187
+ * this.month = this.months[val[1]]
188
+ * this.day = this.days[val[2]]
189
+ * }
190
+ * }
191
+ * }
192
+ * </script>
129
193
  * ```
130
194
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/picker-view.html
131
195
  */
@@ -4,7 +4,7 @@ import { StandardProps, CommonEventFunction } from './common'
4
4
  /** 滚动选择器子项
5
5
  * 仅可放置于 `<PickerView />` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致
6
6
  * @classification forms
7
- * @supported weapp, swan, alipay, tt
7
+ * @supported weapp, swan, alipay, tt, rn
8
8
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html
9
9
  */
10
10
  declare const PickerViewColumn: ComponentType<StandardProps>
@@ -78,7 +78,7 @@ interface ProgressProps extends StandardProps {
78
78
  /** 进度条。组件属性的长度单位默认为 px
79
79
  * @classification base
80
80
  * @supported weapp, swan, alipay, tt, h5, rn
81
- * @example
81
+ * @example_react
82
82
  * ```tsx
83
83
  * export default class PageView extends Component {
84
84
  * constructor() {
@@ -97,6 +97,17 @@ interface ProgressProps extends StandardProps {
97
97
  * }
98
98
  * }
99
99
  * ```
100
+ * @example_vue
101
+ * ```html
102
+ * <template>
103
+ * <view class="components-page">
104
+ * <progress percent="20" stroke-width="2" :show-info="true" />
105
+ * <progress percent="40" stroke-width="2" :active="true" />
106
+ * <progress percent="60" stroke-width="2" :active="true" />
107
+ * <progress percent="80" stroke-width="2" :active="true" active-color="blue" />
108
+ * </view>
109
+ * </template>
110
+ * ```
100
111
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/progress.html
101
112
  */
102
113
  declare const Progress: ComponentType<ProgressProps>