@tarojs/components 3.4.0-beta.3 → 3.5.0-canary.1
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/taro-input-core.cjs.entry.js +13 -1
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/collection/components/input/input.js +27 -1
- package/dist/collection/components/scroll-view/scroll-view.js +3 -3
- package/dist/collection/components/tabbar/style/index.css +1 -1
- package/dist/esm/taro-input-core.entry.js +13 -1
- package/dist/esm/taro-scroll-view-core.entry.js +3 -3
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.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-33ee636a.system.js +1 -1
- package/dist/taro-components/p-9dc9c615.system.entry.js +1 -0
- package/dist/taro-components/p-abe415b4.system.entry.js +1 -0
- package/dist/taro-components/p-b55fedc1.entry.js +1 -0
- package/dist/taro-components/{p-6965567d.entry.js → p-cc818a13.entry.js} +1 -1
- package/dist/taro-components/{p-dd34408a.entry.js → p-e1040131.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 -0
- package/dist/types/components.d.ts +1 -0
- package/dist-h5/vue/components/picker.js +2 -1
- package/package.json +3 -3
- package/types/Ad.d.ts +13 -1
- package/types/Audio.d.ts +22 -2
- package/types/Button.d.ts +84 -11
- package/types/Camera.d.ts +1 -1
- 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/Icon.d.ts +17 -1
- package/types/Image.d.ts +22 -2
- package/types/Input.d.ts +66 -5
- package/types/Label.d.ts +18 -4
- package/types/LivePlayer.d.ts +7 -1
- package/types/LivePusher.d.ts +7 -1
- package/types/Map.d.ts +55 -1
- package/types/MatchMedia.d.ts +24 -5
- package/types/MovableArea.d.ts +9 -3
- package/types/MovableView.d.ts +20 -6
- package/types/OfficialAccount.d.ts +0 -6
- package/types/OpenData.d.ts +7 -1
- package/types/PageContainer.d.ts +6 -0
- package/types/Picker.d.ts +64 -1
- 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/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 +41 -21
- package/types/View.d.ts +33 -1
- package/types/VoipRoom.d.ts +5 -6
- package/types/WebView.d.ts +7 -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/Form.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface FormProps extends StandardProps {
|
|
|
20
20
|
|
|
21
21
|
/** 携带 form 中的数据触发 submit 事件
|
|
22
22
|
* event.detail = { value : {'name': 'value'} , formId: '' }
|
|
23
|
-
* @supported weapp
|
|
23
|
+
* @supported weapp, rn
|
|
24
24
|
*/
|
|
25
25
|
onSubmit?: CommonEventFunction<FormProps.onSubmitEventDetail>
|
|
26
26
|
|
|
@@ -50,7 +50,7 @@ declare namespace FormProps {
|
|
|
50
50
|
* 当点击 form 表单中 form-type 为 submit 的 button 组件时,会将表单组件中的 value 值进行提交,需要在表单组件中加上 name 来作为 key。
|
|
51
51
|
* @classification forms
|
|
52
52
|
* @supported weapp, h5, rn
|
|
53
|
-
* @
|
|
53
|
+
* @example_react
|
|
54
54
|
* ```tsx
|
|
55
55
|
* class App extends Component {
|
|
56
56
|
*
|
|
@@ -73,6 +73,37 @@ declare namespace FormProps {
|
|
|
73
73
|
* }
|
|
74
74
|
* }
|
|
75
75
|
* ```
|
|
76
|
+
* @example_vue
|
|
77
|
+
* ```html
|
|
78
|
+
* <template>
|
|
79
|
+
* <form `@submit="formSubmit" `@reset="formReset" >
|
|
80
|
+
* <view class="taro-example-body">
|
|
81
|
+
* <switch name="switch" class="form-switch"></Switch>
|
|
82
|
+
* </view>
|
|
83
|
+
* <view class="taro-example-btns">
|
|
84
|
+
* <button form-type="submit">Submit</button>
|
|
85
|
+
* <button type="default" form-type="reset">Reset</button>
|
|
86
|
+
* </view>
|
|
87
|
+
* </form>
|
|
88
|
+
* </template>
|
|
89
|
+
*
|
|
90
|
+
* <script>
|
|
91
|
+
* export default {
|
|
92
|
+
* data() {
|
|
93
|
+
* return {}
|
|
94
|
+
* },
|
|
95
|
+
* methods: {
|
|
96
|
+
* formSubmit (e) {
|
|
97
|
+
* console.log(e)
|
|
98
|
+
* },
|
|
99
|
+
*
|
|
100
|
+
* formReset (e) {
|
|
101
|
+
* console.log(e)
|
|
102
|
+
* }
|
|
103
|
+
* }
|
|
104
|
+
* }
|
|
105
|
+
* </script>
|
|
106
|
+
* ```
|
|
76
107
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/form.html
|
|
77
108
|
*/
|
|
78
109
|
declare const Form: ComponentType<FormProps>
|
package/types/Icon.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ declare namespace IconProps {
|
|
|
50
50
|
/** 图标。组件属性的长度单位默认为 px
|
|
51
51
|
* @classification base
|
|
52
52
|
* @supported weapp, swan, alipay, tt, h5, rn
|
|
53
|
-
* @
|
|
53
|
+
* @example_react
|
|
54
54
|
* ```tsx
|
|
55
55
|
* export default class PageView extends Component {
|
|
56
56
|
* constructor() {
|
|
@@ -76,6 +76,22 @@ declare namespace IconProps {
|
|
|
76
76
|
* }
|
|
77
77
|
* }
|
|
78
78
|
* ```
|
|
79
|
+
* @example_vue
|
|
80
|
+
* <template>
|
|
81
|
+
* <view class="components-page">
|
|
82
|
+
* <icon size="60" type="success" />
|
|
83
|
+
* <icon size="60" type="info" />
|
|
84
|
+
* <icon size="60" type="warn" color="#ccc" />
|
|
85
|
+
* <icon size="60" type="warn" />
|
|
86
|
+
* <icon size="60" type="waiting" />
|
|
87
|
+
* <icon size="20" type="success_no_circle" />
|
|
88
|
+
* <icon size="20" type="warn" />
|
|
89
|
+
* <icon size="20" type="success" />
|
|
90
|
+
* <icon size="20" type="download" />
|
|
91
|
+
* <icon size="20" type="clear" color="red" />
|
|
92
|
+
* <icon size="20" type="search" />
|
|
93
|
+
* </view>
|
|
94
|
+
* </template>
|
|
79
95
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/icon.html
|
|
80
96
|
*/
|
|
81
97
|
declare const Icon: ComponentType<IconProps>
|
package/types/Image.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ interface ImageProps extends StandardProps {
|
|
|
28
28
|
|
|
29
29
|
/** 图片懒加载。只针对 page 与 scroll-view 下的 image 有效
|
|
30
30
|
* @default false
|
|
31
|
-
* @supported weapp, swan, alipay, tt
|
|
31
|
+
* @supported weapp, swan, alipay, tt, h5
|
|
32
32
|
*/
|
|
33
33
|
lazyLoad?: boolean
|
|
34
34
|
|
|
@@ -53,6 +53,11 @@ interface ImageProps extends StandardProps {
|
|
|
53
53
|
* @supported h5
|
|
54
54
|
*/
|
|
55
55
|
imgProps?: ImgHTMLAttributes<HTMLImageElement>
|
|
56
|
+
|
|
57
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
58
|
+
* @supported h5
|
|
59
|
+
*/
|
|
60
|
+
nativeProps?: Record<string, unknown>
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
declare namespace ImageProps {
|
|
@@ -104,7 +109,7 @@ declare namespace ImageProps {
|
|
|
104
109
|
* **Note:** 为实现小程序的 `mode` 特性,在 H5 组件中使用一个 `div` 容器来对内部的 `img` 进行展示区域的裁剪,因此请勿使用元素选择器来重置 `img` 的样式!
|
|
105
110
|
* @classification media
|
|
106
111
|
* @supported weapp, h5, rn, swan, alipay, tt
|
|
107
|
-
* @
|
|
112
|
+
* @example_react
|
|
108
113
|
* ```tsx
|
|
109
114
|
* export default class PageView extends Component {
|
|
110
115
|
* constructor() {
|
|
@@ -127,6 +132,21 @@ declare namespace ImageProps {
|
|
|
127
132
|
* }
|
|
128
133
|
* }
|
|
129
134
|
* ```
|
|
135
|
+
* @example_vue
|
|
136
|
+
* ```html
|
|
137
|
+
* <template>
|
|
138
|
+
* <view class="components-page">
|
|
139
|
+
* <image
|
|
140
|
+
* style="width: 300px;height: 100px;background: #fff;"
|
|
141
|
+
* src="nerv_logo.png"
|
|
142
|
+
* />
|
|
143
|
+
* <image
|
|
144
|
+
* style="width: 300px;height: 100px;background: #fff;"
|
|
145
|
+
* src="https://camo.githubusercontent.com/3e1b76e514b895760055987f164ce6c95935a3aa/687474703a2f2f73746f726167652e333630627579696d672e636f6d2f6d74642f686f6d652f6c6f676f2d3278313531333833373932363730372e706e67"
|
|
146
|
+
* />
|
|
147
|
+
* </view>
|
|
148
|
+
* </template>
|
|
149
|
+
* ```
|
|
130
150
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/image.html
|
|
131
151
|
*/
|
|
132
152
|
declare const Image: ComponentType<ImageProps>
|
package/types/Input.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
12
12
|
* @supported weapp, h5, rn
|
|
13
13
|
* @rn 部分支持
|
|
14
14
|
*/
|
|
15
|
-
type?: 'text' | 'number' | 'idcard' | 'digit'
|
|
15
|
+
type?: 'text' | 'number' | 'idcard' | 'digit' | 'safe-password' | 'nickname'
|
|
16
16
|
|
|
17
17
|
/** 是否是密码类型
|
|
18
18
|
* @supported weapp, h5, rn
|
|
@@ -63,7 +63,6 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
63
63
|
*/
|
|
64
64
|
focus?: boolean
|
|
65
65
|
|
|
66
|
-
|
|
67
66
|
/** 设置键盘右下角按钮的文字
|
|
68
67
|
* @default done
|
|
69
68
|
* @supported weapp, rn
|
|
@@ -112,6 +111,41 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
112
111
|
*/
|
|
113
112
|
alwaysEmbed?: boolean
|
|
114
113
|
|
|
114
|
+
/**
|
|
115
|
+
* 安全键盘加密公钥的路径,只支持包内路径
|
|
116
|
+
* @supported weapp
|
|
117
|
+
*/
|
|
118
|
+
safePasswordCertPath?: string
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 安全键盘输入密码长度
|
|
122
|
+
* @supported weapp
|
|
123
|
+
*/
|
|
124
|
+
safePasswordLength?: number
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 安全键盘加密时间戳
|
|
128
|
+
* @supported weapp
|
|
129
|
+
*/
|
|
130
|
+
safePasswordTimeStamp?: number
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 安全键盘加密盐值
|
|
134
|
+
* @supported weapp
|
|
135
|
+
*/
|
|
136
|
+
safePasswordNonce?: string
|
|
137
|
+
/**
|
|
138
|
+
* 安全键盘计算hash盐值,若指定custom-hash 则无效
|
|
139
|
+
* @supported weapp
|
|
140
|
+
*/
|
|
141
|
+
safePasswordSalt?: string
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 安全键盘计算hash的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))`
|
|
145
|
+
* @supported weapp
|
|
146
|
+
*/
|
|
147
|
+
safePasswordCustomHash?: string
|
|
148
|
+
|
|
115
149
|
/**
|
|
116
150
|
* 当 type 为 number, digit, idcard 数字键盘是否随机排列
|
|
117
151
|
* @default false
|
|
@@ -147,7 +181,7 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
147
181
|
*
|
|
148
182
|
* event.detail = {value: value}
|
|
149
183
|
* @supported weapp, rn
|
|
150
|
-
* @h5 借用[Form 组件](form
|
|
184
|
+
* @h5 借用[Form 组件](./form)的`onSubmit`事件来替代
|
|
151
185
|
*/
|
|
152
186
|
onConfirm?: CommonEventFunction<InputProps.inputValueEventDetail>
|
|
153
187
|
|
|
@@ -157,9 +191,15 @@ interface InputProps extends StandardProps, FormItemProps {
|
|
|
157
191
|
* @supported weapp
|
|
158
192
|
*/
|
|
159
193
|
onKeyboardHeightChange?: CommonEventFunction<InputProps.onKeyboardHeightChangeEventDetail>
|
|
194
|
+
|
|
195
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
196
|
+
* @supported h5
|
|
197
|
+
*/
|
|
198
|
+
nativeProps?: Record<string, unknown>
|
|
160
199
|
}
|
|
161
200
|
|
|
162
201
|
declare namespace InputProps {
|
|
202
|
+
/** > 注意:React-Native 端 `inputEventDetail` 仅实现参数 `value`,若需实时获取光标位置则可通过 [`onSelectionChange`](https://reactnative.dev/docs/textinput#onselectionchange) 实现。 */
|
|
163
203
|
interface inputEventDetail {
|
|
164
204
|
/** 输入值 */
|
|
165
205
|
value: string
|
|
@@ -190,7 +230,7 @@ declare namespace InputProps {
|
|
|
190
230
|
/** 输入框。该组件是原生组件,使用时请注意相关限制
|
|
191
231
|
* @classification forms
|
|
192
232
|
* @supported weapp, h5, rn
|
|
193
|
-
* @
|
|
233
|
+
* @example_react
|
|
194
234
|
* ```tsx
|
|
195
235
|
* class App extends Component {
|
|
196
236
|
*
|
|
@@ -204,7 +244,7 @@ declare namespace InputProps {
|
|
|
204
244
|
* <Text>数字输入的 input</Text>
|
|
205
245
|
* <Input type='number' placeholder='这是一个数字输入框'/>
|
|
206
246
|
* <Text>密码输入的 input</Text>
|
|
207
|
-
* <Input type='
|
|
247
|
+
* <Input type='password' password placeholder='这是一个密码输入框'/>
|
|
208
248
|
* <Text>带小数点的 input</Text>
|
|
209
249
|
* <Input type='digit' placeholder='带小数点的数字键盘'/>
|
|
210
250
|
* <Text>身份证输入的 input</Text>
|
|
@@ -216,6 +256,27 @@ declare namespace InputProps {
|
|
|
216
256
|
* }
|
|
217
257
|
* }
|
|
218
258
|
* ```
|
|
259
|
+
* @example_vue
|
|
260
|
+
* ```html
|
|
261
|
+
* <template>
|
|
262
|
+
* <view class="example-body">
|
|
263
|
+
* <text>可以自动聚焦的 input</text>
|
|
264
|
+
* <input type="text" placeholder="将会获取焦点" :focus="true" />
|
|
265
|
+
* <text>控制最大输入长度的 input</text>
|
|
266
|
+
* <input type="text" placeholder="最大输入长度为 10" maxlength="10"/>
|
|
267
|
+
* <text>数字输入的 input</text>
|
|
268
|
+
* <input type="number" placeholder="这是一个数字输入框"/>
|
|
269
|
+
* <text>密码输入的 input</text>
|
|
270
|
+
* <input type="password" :password="true" placeholder="这是一个密码输入框"/>
|
|
271
|
+
* <text>带小数点的 input</text>
|
|
272
|
+
* <input type="digit" placeholder="带小数点的数字键盘"/>
|
|
273
|
+
* <text>身份证输入的 input</text>
|
|
274
|
+
* <input type="idcard" placeholder="身份证输入键盘"/>
|
|
275
|
+
* <text>控制占位符颜色的 input</text>
|
|
276
|
+
* <input type="text" placeholder="占位符字体是红色的" placeholder-style="color:red;"/>
|
|
277
|
+
* </view>
|
|
278
|
+
* </template>
|
|
279
|
+
* ```
|
|
219
280
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/input.html
|
|
220
281
|
*/
|
|
221
282
|
declare const Input: ComponentType<InputProps>
|
package/types/Label.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ import { StandardProps } from './common'
|
|
|
3
3
|
|
|
4
4
|
interface LabelProps extends StandardProps {
|
|
5
5
|
|
|
6
|
-
/** 绑定控件的 id
|
|
7
|
-
*/
|
|
6
|
+
/** 绑定控件的 id */
|
|
8
7
|
for?: string
|
|
9
8
|
}
|
|
10
9
|
|
|
@@ -12,8 +11,8 @@ interface LabelProps extends StandardProps {
|
|
|
12
11
|
*
|
|
13
12
|
* 使用for属性找到对应的id,或者将控件放在该标签下,当点击时,就会触发对应的控件。 for优先级高于内部控件,内部有多个控件的时候默认触发第一个控件。 目前可以绑定的控件有:button, checkbox, radio, switch。
|
|
14
13
|
* @classification forms
|
|
15
|
-
* @supported weapp, swan, alipay, tt, h5
|
|
16
|
-
* @
|
|
14
|
+
* @supported weapp, swan, alipay, tt, h5, rn
|
|
15
|
+
* @example_react
|
|
17
16
|
* ```tsx
|
|
18
17
|
* class App extends Components {
|
|
19
18
|
*
|
|
@@ -33,6 +32,21 @@ interface LabelProps extends StandardProps {
|
|
|
33
32
|
* }
|
|
34
33
|
* }
|
|
35
34
|
* ```
|
|
35
|
+
* @example_vue
|
|
36
|
+
* ```html
|
|
37
|
+
* <template>
|
|
38
|
+
* <radio-group>
|
|
39
|
+
* <label class="example-body__label" for="1" key="1">
|
|
40
|
+
* <radio id="1" value="USA" />
|
|
41
|
+
* USA
|
|
42
|
+
* </label>
|
|
43
|
+
* <label class="example-body__label" for="2" key="2">
|
|
44
|
+
* <radio id="2" value="CHN" :checked="true" />
|
|
45
|
+
* CHN
|
|
46
|
+
* </label>
|
|
47
|
+
* </radio-group>
|
|
48
|
+
* </template>
|
|
49
|
+
* ```
|
|
36
50
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/label.html
|
|
37
51
|
*/
|
|
38
52
|
declare const Label: ComponentType<LabelProps>
|
package/types/LivePlayer.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ declare namespace LivePlayerProps {
|
|
|
209
209
|
* 需要先通过类目审核,再在小程序管理后台,“设置”-“接口设置”中自助开通该组件权限。
|
|
210
210
|
* @classification media
|
|
211
211
|
* @supported weapp
|
|
212
|
-
* @
|
|
212
|
+
* @example_react
|
|
213
213
|
* ```tsx
|
|
214
214
|
* class App extends Components {
|
|
215
215
|
* render () {
|
|
@@ -219,6 +219,12 @@ declare namespace LivePlayerProps {
|
|
|
219
219
|
* }
|
|
220
220
|
* }
|
|
221
221
|
* ```
|
|
222
|
+
* @example_vue
|
|
223
|
+
* ```html
|
|
224
|
+
* <template>
|
|
225
|
+
* <live-player src="url" mode="live" :autoplay="true" />
|
|
226
|
+
* </template>
|
|
227
|
+
* ```
|
|
222
228
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html
|
|
223
229
|
*/
|
|
224
230
|
declare const LivePlayer: ComponentType<LivePlayerProps>
|
package/types/LivePusher.d.ts
CHANGED
|
@@ -324,7 +324,7 @@ declare namespace LivePusherProps {
|
|
|
324
324
|
* 需要先通过类目审核,再在小程序管理后台,「开发」-「接口设置」中自助开通该组件权限。
|
|
325
325
|
* @classification media
|
|
326
326
|
* @supported weapp
|
|
327
|
-
* @
|
|
327
|
+
* @example_react
|
|
328
328
|
* ```tsx
|
|
329
329
|
* class App extends Components {
|
|
330
330
|
* render () {
|
|
@@ -334,6 +334,12 @@ declare namespace LivePusherProps {
|
|
|
334
334
|
* }
|
|
335
335
|
* }
|
|
336
336
|
* ```
|
|
337
|
+
* @example_vue
|
|
338
|
+
* ```html
|
|
339
|
+
* <template>
|
|
340
|
+
* <live-pusher url="url" mode="RTC" :autopush="true" />
|
|
341
|
+
* </template>
|
|
342
|
+
* ```
|
|
337
343
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html
|
|
338
344
|
*/
|
|
339
345
|
declare const LivePusher: ComponentType<LivePusherProps>
|
package/types/Map.d.ts
CHANGED
|
@@ -551,7 +551,7 @@ declare namespace MapProps {
|
|
|
551
551
|
/** 地图。相关api Taro.createMapContext。
|
|
552
552
|
* @classification maps
|
|
553
553
|
* @supported weapp, alipay, swan
|
|
554
|
-
* @
|
|
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>
|
package/types/MatchMedia.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
44
|
+
* @classification viewContainer
|
|
45
|
+
* @example_react
|
|
46
46
|
* ```tsx
|
|
47
47
|
* class App extends Components {
|
|
48
48
|
* render () {
|
|
49
49
|
* return (
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
package/types/MovableArea.d.ts
CHANGED
|
@@ -11,19 +11,25 @@ interface MovableAreaProps extends StandardProps {
|
|
|
11
11
|
|
|
12
12
|
/** movable-view 的可移动区域
|
|
13
13
|
* @classification viewContainer
|
|
14
|
-
* @supported weapp
|
|
15
|
-
* @
|
|
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'
|
|
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>
|
package/types/MovableView.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
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>
|
|
@@ -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
|
package/types/OpenData.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ declare namespace OpenDataProps {
|
|
|
66
66
|
/** 用于展示微信开放的数据
|
|
67
67
|
* @classification open
|
|
68
68
|
* @supported weapp
|
|
69
|
-
* @
|
|
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>
|
package/types/PageContainer.d.ts
CHANGED
|
@@ -91,10 +91,15 @@ interface PageContainerProps extends StandardProps {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
declare namespace PageContainerProps {
|
|
94
|
+
/** 弹出位置 */
|
|
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>
|