@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/Picker.d.ts
CHANGED
|
@@ -247,7 +247,7 @@ declare namespace PickerRegionProps {
|
|
|
247
247
|
* 从底部弹起的滚动选择器
|
|
248
248
|
* @classification forms
|
|
249
249
|
* @supported weapp, h5, rn, swan, alipay, tt
|
|
250
|
-
* @
|
|
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>
|
package/types/PickerView.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
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>
|
package/types/Progress.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
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>
|
package/types/Radio.d.ts
CHANGED
|
@@ -24,12 +24,17 @@ interface RadioProps extends StandardProps {
|
|
|
24
24
|
* @supported weapp, rn
|
|
25
25
|
*/
|
|
26
26
|
color?: string
|
|
27
|
+
|
|
28
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
29
|
+
* @supported h5
|
|
30
|
+
*/
|
|
31
|
+
nativeProps?: Record<string, unknown>
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
/** 单选项目
|
|
30
35
|
* @classification forms
|
|
31
36
|
* @supported weapp, h5, rn
|
|
32
|
-
* @
|
|
37
|
+
* @example_react
|
|
33
38
|
* ```tsx
|
|
34
39
|
* export default class PageRadio extends Component {
|
|
35
40
|
* state = {
|
|
@@ -96,6 +101,77 @@ interface RadioProps extends StandardProps {
|
|
|
96
101
|
* }
|
|
97
102
|
* }
|
|
98
103
|
* ```
|
|
104
|
+
* @example_vue
|
|
105
|
+
* ```html
|
|
106
|
+
* <template>
|
|
107
|
+
* <view class="container">
|
|
108
|
+
* <view class="page-section">
|
|
109
|
+
* <text>默认样式</text>
|
|
110
|
+
* <radio value="选中" :checked="true">选中</radio>
|
|
111
|
+
* <radio style="margin-left: 20rpx;" value="未选中">未选中</radio>
|
|
112
|
+
* </view>
|
|
113
|
+
* <view class="page-section">
|
|
114
|
+
* <text>推荐展示样式(Taro 团队成员):</text>
|
|
115
|
+
* <radio-group `@change="onChange">
|
|
116
|
+
* <label v-for="item in list" class="checkbox-list__label">
|
|
117
|
+
* <radio class="checkbox-list__checkbox" :value="item.value" :checked="item.checked">{{ item.text }}</radio>
|
|
118
|
+
* </label>
|
|
119
|
+
* </radio-group>
|
|
120
|
+
* </view>
|
|
121
|
+
* </view>
|
|
122
|
+
* </template>
|
|
123
|
+
*
|
|
124
|
+
* <script>
|
|
125
|
+
* export default {
|
|
126
|
+
* data() {
|
|
127
|
+
* return {
|
|
128
|
+
* list: [
|
|
129
|
+
* {
|
|
130
|
+
* value: 'yuche',
|
|
131
|
+
* text: 'yuche',
|
|
132
|
+
* checked: false
|
|
133
|
+
* },
|
|
134
|
+
* {
|
|
135
|
+
* value: 'cjj',
|
|
136
|
+
* text: 'cjj',
|
|
137
|
+
* checked: false
|
|
138
|
+
* },
|
|
139
|
+
* {
|
|
140
|
+
* value: 'xiexiaoli',
|
|
141
|
+
* text: 'xiexiaoli',
|
|
142
|
+
* checked: false
|
|
143
|
+
* },
|
|
144
|
+
* {
|
|
145
|
+
* value: 'honly',
|
|
146
|
+
* text: 'honly',
|
|
147
|
+
* checked: false
|
|
148
|
+
* },
|
|
149
|
+
* {
|
|
150
|
+
* value: 'cs',
|
|
151
|
+
* text: 'cs',
|
|
152
|
+
* checked: false
|
|
153
|
+
* },
|
|
154
|
+
* {
|
|
155
|
+
* value: 'zhutianjian',
|
|
156
|
+
* text: 'zhutianjian',
|
|
157
|
+
* checked: false
|
|
158
|
+
* },
|
|
159
|
+
* {
|
|
160
|
+
* value: '隔壁老李',
|
|
161
|
+
* text: '隔壁老李',
|
|
162
|
+
* checked: true
|
|
163
|
+
* }
|
|
164
|
+
* ]
|
|
165
|
+
* }
|
|
166
|
+
* },
|
|
167
|
+
* methods: {
|
|
168
|
+
* onChange: function(e) {
|
|
169
|
+
* console.log(e.detail.value)
|
|
170
|
+
* }
|
|
171
|
+
* }
|
|
172
|
+
* }
|
|
173
|
+
* </script>
|
|
174
|
+
* ```
|
|
99
175
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/radio.html
|
|
100
176
|
*/
|
|
101
177
|
declare const Radio: ComponentType<RadioProps>
|
package/types/RichText.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ declare namespace RichTextProps {
|
|
|
65
65
|
/** 富文本
|
|
66
66
|
* @classification base
|
|
67
67
|
* @supported weapp, swan, alipay, tt, h5, rn
|
|
68
|
-
* @
|
|
68
|
+
* @example_react
|
|
69
69
|
* ```tsx
|
|
70
70
|
* class App extends Components {
|
|
71
71
|
* state = {
|
|
@@ -88,6 +88,38 @@ declare namespace RichTextProps {
|
|
|
88
88
|
* }
|
|
89
89
|
* }
|
|
90
90
|
* ```
|
|
91
|
+
* @example_vue
|
|
92
|
+
* ```html
|
|
93
|
+
* <template>
|
|
94
|
+
* <view class="components-page">
|
|
95
|
+
* <rich-text :nodes="nodes"></rich-text>
|
|
96
|
+
* </view>
|
|
97
|
+
* </template>
|
|
98
|
+
*
|
|
99
|
+
* <script>
|
|
100
|
+
* export default {
|
|
101
|
+
* name: 'Index',
|
|
102
|
+
* data() {
|
|
103
|
+
* return {
|
|
104
|
+
* nodes: [{
|
|
105
|
+
* name: 'div',
|
|
106
|
+
* attrs: {
|
|
107
|
+
* class: 'div_class',
|
|
108
|
+
* style: 'line-height: 60px; color: red;'
|
|
109
|
+
* },
|
|
110
|
+
* children: [{
|
|
111
|
+
* type: 'text',
|
|
112
|
+
* text: 'Hello World!'
|
|
113
|
+
* }]
|
|
114
|
+
* }]
|
|
115
|
+
* }
|
|
116
|
+
* },
|
|
117
|
+
* onReady () {
|
|
118
|
+
* console.log('onReady')
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
* </script>
|
|
122
|
+
* ```
|
|
91
123
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html
|
|
92
124
|
*/
|
|
93
125
|
declare const RichText: ComponentType<RichTextProps>
|
package/types/ScrollView.d.ts
CHANGED
|
@@ -98,31 +98,31 @@ interface ScrollViewProps extends StandardProps {
|
|
|
98
98
|
refresherTriggered?: boolean
|
|
99
99
|
|
|
100
100
|
/** 启用 scroll-view 增强特性
|
|
101
|
-
* @supported weapp
|
|
101
|
+
* @supported weapp
|
|
102
102
|
* @default false
|
|
103
103
|
*/
|
|
104
104
|
enhanced?: boolean
|
|
105
105
|
|
|
106
106
|
/** iOS 下 scroll-view 边界弹性控制 (同时开启 enhanced 属性后生效)
|
|
107
|
-
* @supported weapp
|
|
107
|
+
* @supported weapp
|
|
108
108
|
* @default true
|
|
109
109
|
*/
|
|
110
110
|
bounces?: boolean
|
|
111
111
|
|
|
112
112
|
/** 滚动条显隐控制 (同时开启 enhanced 属性后生效)
|
|
113
|
-
* @supported weapp
|
|
113
|
+
* @supported weapp
|
|
114
114
|
* @default true
|
|
115
115
|
*/
|
|
116
116
|
showScrollbar?: boolean
|
|
117
117
|
|
|
118
118
|
/** 分页滑动效果 (同时开启 enhanced 属性后生效)
|
|
119
|
-
* @supported weapp
|
|
119
|
+
* @supported weapp
|
|
120
120
|
* @default false
|
|
121
121
|
*/
|
|
122
122
|
pagingEnabled?: boolean
|
|
123
123
|
|
|
124
124
|
/** boolean false 滑动减速速率控制 (同时开启 enhanced 属性后生效)
|
|
125
|
-
* @supported weapp
|
|
125
|
+
* @supported weapp
|
|
126
126
|
* @default false
|
|
127
127
|
*/
|
|
128
128
|
fastDeceleration?: boolean
|
|
@@ -164,17 +164,17 @@ interface ScrollViewProps extends StandardProps {
|
|
|
164
164
|
onRefresherAbort?: CommonEventFunction
|
|
165
165
|
|
|
166
166
|
/** 滑动开始事件 (同时开启 enhanced 属性后生效)
|
|
167
|
-
* @supported weapp
|
|
167
|
+
* @supported weapp
|
|
168
168
|
*/
|
|
169
169
|
onDragStart?: CommonEventFunction
|
|
170
170
|
|
|
171
171
|
/** 滑动事件 (同时开启 enhanced 属性后生效)
|
|
172
|
-
* @supported weapp
|
|
172
|
+
* @supported weapp
|
|
173
173
|
*/
|
|
174
174
|
onDragging?: CommonEventFunction
|
|
175
175
|
|
|
176
176
|
/** 滑动结束事件 (同时开启 enhanced 属性后生效)
|
|
177
|
-
* @supported weapp
|
|
177
|
+
* @supported weapp
|
|
178
178
|
*/
|
|
179
179
|
onDragEnd?: CommonEventFunction
|
|
180
180
|
}
|
|
@@ -200,7 +200,8 @@ declare namespace ScrollViewProps {
|
|
|
200
200
|
* H5 中 ScrollView 组件是通过一个高度(或宽度)固定的容器内部滚动来实现的,因此务必正确的设置容器的高度。例如: 如果 ScrollView 的高度将 body 撑开,就会同时存在两个滚动条(body 下的滚动条,以及 ScrollView 的滚动条)。
|
|
201
201
|
* 微信小程序 中 ScrollView 组件如果设置 scrollX 横向滚动时,并且子元素为多个时(单个子元素时设置固定宽度则可以正常横向滚动),需要通过 WXSS 设置 `white-space: nowrap` 来保证元素不换行,并对 ScrollView 内部元素设置 `display: inline-block` 来使其能够横向滚动。
|
|
202
202
|
* @classification viewContainer
|
|
203
|
-
* @
|
|
203
|
+
* @supported weapp, swan, alipay, tt, h5, rn
|
|
204
|
+
* @example_react
|
|
204
205
|
* ```tsx
|
|
205
206
|
* export default class PageView extends Component {
|
|
206
207
|
* constructor() {
|
|
@@ -255,6 +256,87 @@ declare namespace ScrollViewProps {
|
|
|
255
256
|
* }
|
|
256
257
|
* }
|
|
257
258
|
* ```
|
|
259
|
+
* @example_vue
|
|
260
|
+
* ```html
|
|
261
|
+
* <template>
|
|
262
|
+
* <view class="container">
|
|
263
|
+
* <view class="page-body">
|
|
264
|
+
* <view class="page-section">
|
|
265
|
+
* <view class="page-section-title">
|
|
266
|
+
* <text>Vertical Scroll - 纵向滚动</text>
|
|
267
|
+
* </view>
|
|
268
|
+
* <view class="page-section-spacing">
|
|
269
|
+
* <scroll-view :scroll-y="true" style="height: 300rpx;" `@scrolltoupper="upper" `@scrolltolower="lower" `@scroll="scroll" :scroll-into-view="toView" :scroll-top="scrollTop">
|
|
270
|
+
* <view id="demo1" class="scroll-view-item demo-text-1">1</view>
|
|
271
|
+
* <view id="demo2" class="scroll-view-item demo-text-2">2</view>
|
|
272
|
+
* <view id="demo3" class="scroll-view-item demo-text-3">3</view>
|
|
273
|
+
* </scroll-view>
|
|
274
|
+
* </view>
|
|
275
|
+
* </view>
|
|
276
|
+
* <view class="page-section">
|
|
277
|
+
* <view class="page-section-title">
|
|
278
|
+
* <text>Horizontal Scroll - 横向滚动</text>
|
|
279
|
+
* </view>
|
|
280
|
+
* <view class="page-section-spacing">
|
|
281
|
+
* <scroll-view class="scroll-view_H" :scroll-x="true" `@scroll="scroll" style="width: 100%">
|
|
282
|
+
* <view id="demo21" class="scroll-view-item_H demo-text-1">a</view>
|
|
283
|
+
* <view id="demo22" class="scroll-view-item_H demo-text-2">b</view>
|
|
284
|
+
* <view id="demo23" class="scroll-view-item_H demo-text-3">c</view>
|
|
285
|
+
* </scroll-view>
|
|
286
|
+
* </view>
|
|
287
|
+
* </view>
|
|
288
|
+
* </view>
|
|
289
|
+
* </view>
|
|
290
|
+
* </template>
|
|
291
|
+
*
|
|
292
|
+
* <script>
|
|
293
|
+
* const order = ['demo1', 'demo2', 'demo3']
|
|
294
|
+
* export default {
|
|
295
|
+
* name: 'Index',
|
|
296
|
+
* data() {
|
|
297
|
+
* return {
|
|
298
|
+
* scrollTop: 0,
|
|
299
|
+
* toView: 'demo2'
|
|
300
|
+
* }
|
|
301
|
+
* },
|
|
302
|
+
*
|
|
303
|
+
* methods: {
|
|
304
|
+
* upper(e) {
|
|
305
|
+
* console.log('upper:', e)
|
|
306
|
+
* },
|
|
307
|
+
*
|
|
308
|
+
* lower(e) {
|
|
309
|
+
* console.log('lower:', e)
|
|
310
|
+
* },
|
|
311
|
+
*
|
|
312
|
+
* scroll(e) {
|
|
313
|
+
* console.log('scroll:', e)
|
|
314
|
+
* }
|
|
315
|
+
* }
|
|
316
|
+
* }
|
|
317
|
+
* </script>
|
|
318
|
+
*
|
|
319
|
+
* <style>
|
|
320
|
+
* .page-section-spacing{
|
|
321
|
+
* margin-top: 60rpx;
|
|
322
|
+
* }
|
|
323
|
+
* .scroll-view_H{
|
|
324
|
+
* white-space: nowrap;
|
|
325
|
+
* }
|
|
326
|
+
* .scroll-view-item{
|
|
327
|
+
* height: 300rpx;
|
|
328
|
+
* }
|
|
329
|
+
* .scroll-view-item_H{
|
|
330
|
+
* display: inline-block;
|
|
331
|
+
* width: 100%;
|
|
332
|
+
* height: 300rpx;
|
|
333
|
+
* }
|
|
334
|
+
*
|
|
335
|
+
* .demo-text-1 { background: #ccc; }
|
|
336
|
+
* .demo-text-2 { background: #999; }
|
|
337
|
+
* .demo-text-3 { background: #666; }
|
|
338
|
+
* </style>
|
|
339
|
+
* ```
|
|
258
340
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html
|
|
259
341
|
*/
|
|
260
342
|
declare const ScrollView: ComponentType<ScrollViewProps>
|
package/types/Slider.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ declare namespace SliderProps {
|
|
|
94
94
|
/** 滑动选择器
|
|
95
95
|
* @classification forms
|
|
96
96
|
* @supported weapp, h5, rn, swan, alipay, tt
|
|
97
|
-
* @
|
|
97
|
+
* @example_react
|
|
98
98
|
* ```tsx
|
|
99
99
|
* export default class PageView extends Component {
|
|
100
100
|
* constructor() {
|
|
@@ -115,6 +115,19 @@ declare namespace SliderProps {
|
|
|
115
115
|
* }
|
|
116
116
|
* }
|
|
117
117
|
* ```
|
|
118
|
+
* @example_vue
|
|
119
|
+
* ```html
|
|
120
|
+
* <template>
|
|
121
|
+
* <view class="components-page">
|
|
122
|
+
* <text>设置 step</text>
|
|
123
|
+
* <slider step="1" value="50"/>
|
|
124
|
+
* <text>显示当前 value</text>
|
|
125
|
+
* <slider step="1" value="50" :show-value="true" />
|
|
126
|
+
* <text>设置最小/最大值</text>
|
|
127
|
+
* <slider step="1" value="100" :show-value="true" min="50" max="200"/>
|
|
128
|
+
* </view>
|
|
129
|
+
* </template>
|
|
130
|
+
* ```
|
|
118
131
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/slider.html
|
|
119
132
|
*/
|
|
120
133
|
declare const Slider: ComponentType<SliderProps>
|
package/types/Swiper.d.ts
CHANGED
|
@@ -163,9 +163,10 @@ declare namespace SwiperProps {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
/** 滑块视图容器。其中只可放置 swiper-item 组件,否则会导致未定义的行为。
|
|
166
|
+
* > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
|
|
166
167
|
* @classification viewContainer
|
|
167
168
|
* @supported weapp, swan, alipay, tt, h5, rn
|
|
168
|
-
* @
|
|
169
|
+
* @example_react
|
|
169
170
|
* ```tsx
|
|
170
171
|
* class App extends Component {
|
|
171
172
|
* render () {
|
|
@@ -192,6 +193,30 @@ declare namespace SwiperProps {
|
|
|
192
193
|
* }
|
|
193
194
|
* }
|
|
194
195
|
* ```
|
|
196
|
+
* @example_vue
|
|
197
|
+
* ```html
|
|
198
|
+
* <template>
|
|
199
|
+
* <swiper
|
|
200
|
+
* class='test-h'
|
|
201
|
+
* indicator-color='#999'
|
|
202
|
+
* indicator-active-color='#333'
|
|
203
|
+
* :vertical="true"
|
|
204
|
+
* :circular="true"
|
|
205
|
+
* :indicator-dots="true"
|
|
206
|
+
* :autoplay="true"
|
|
207
|
+
* >
|
|
208
|
+
* <swiper-item>
|
|
209
|
+
* <view class='demo-text-1'>1</view>
|
|
210
|
+
* </swiper-item>
|
|
211
|
+
* <swiper-item>
|
|
212
|
+
* <view class='demo-text-2'>2</view>
|
|
213
|
+
* </swiper-item>
|
|
214
|
+
* <swiper-item>
|
|
215
|
+
* <view class='demo-text-3'>3</view>
|
|
216
|
+
* </swiper-item>
|
|
217
|
+
* </swiper>
|
|
218
|
+
* </template>
|
|
219
|
+
* ```
|
|
195
220
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html
|
|
196
221
|
*/
|
|
197
222
|
declare const Swiper: ComponentType<SwiperProps>
|
package/types/SwiperItem.d.ts
CHANGED
|
@@ -3,15 +3,16 @@ import { StandardProps } from './common'
|
|
|
3
3
|
|
|
4
4
|
interface SwiperItemProps extends StandardProps {
|
|
5
5
|
/** 该 swiper-item 的标识符
|
|
6
|
-
* @supported weapp
|
|
6
|
+
* @supported weapp, swan, alipay, tt, h5, rn
|
|
7
7
|
*/
|
|
8
8
|
itemId?: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/** 仅可放置在 swiper 组件中,宽高自动设置为100%
|
|
12
|
+
* > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147)
|
|
12
13
|
* @classification viewContainer
|
|
13
|
-
* @supported weapp
|
|
14
|
-
* @
|
|
14
|
+
* @supported weapp, swan, alipay, tt, h5, rn
|
|
15
|
+
* @example_react
|
|
15
16
|
* ```tsx
|
|
16
17
|
* class App extends Component {
|
|
17
18
|
* render () {
|
|
@@ -38,6 +39,30 @@ interface SwiperItemProps extends StandardProps {
|
|
|
38
39
|
* }
|
|
39
40
|
* }
|
|
40
41
|
* ```
|
|
42
|
+
* @example_vue
|
|
43
|
+
* ```html
|
|
44
|
+
* <template>
|
|
45
|
+
* <swiper
|
|
46
|
+
* class='test-h'
|
|
47
|
+
* indicator-color='#999'
|
|
48
|
+
* indicator-active-color='#333'
|
|
49
|
+
* :vertical="true"
|
|
50
|
+
* :circular="true"
|
|
51
|
+
* :indicator-dots="true"
|
|
52
|
+
* :autoplay="true"
|
|
53
|
+
* >
|
|
54
|
+
* <swiper-item>
|
|
55
|
+
* <view class='demo-text-1'>1</view>
|
|
56
|
+
* </swiper-item>
|
|
57
|
+
* <swiper-item>
|
|
58
|
+
* <view class='demo-text-2'>2</view>
|
|
59
|
+
* </swiper-item>
|
|
60
|
+
* <swiper-item>
|
|
61
|
+
* <view class='demo-text-3'>3</view>
|
|
62
|
+
* </swiper-item>
|
|
63
|
+
* </swiper>
|
|
64
|
+
* </template>
|
|
65
|
+
* ```
|
|
41
66
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/swiper-item.html
|
|
42
67
|
*/
|
|
43
68
|
declare const SwiperItem: ComponentType<SwiperItemProps>
|
package/types/Switch.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface SwitchProps extends StandardProps, FormItemProps {
|
|
|
10
10
|
|
|
11
11
|
/** 是否禁用
|
|
12
12
|
* @default false
|
|
13
|
-
* @supported weapp
|
|
13
|
+
* @supported weapp, rn
|
|
14
14
|
*/
|
|
15
15
|
disabled?: boolean
|
|
16
16
|
|
|
@@ -27,9 +27,14 @@ interface SwitchProps extends StandardProps, FormItemProps {
|
|
|
27
27
|
color?: string
|
|
28
28
|
|
|
29
29
|
/** checked 改变时触发 change 事件
|
|
30
|
-
* @supported weapp
|
|
30
|
+
* @supported weapp, rn
|
|
31
31
|
*/
|
|
32
32
|
onChange?: CommonEventFunction<SwitchProps.onChangeEventDetail>
|
|
33
|
+
|
|
34
|
+
/** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
|
|
35
|
+
* @supported h5
|
|
36
|
+
*/
|
|
37
|
+
nativeProps?: Record<string, unknown>
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
declare namespace SwitchProps {
|
|
@@ -40,7 +45,7 @@ declare namespace SwitchProps {
|
|
|
40
45
|
|
|
41
46
|
/** 开关选择器
|
|
42
47
|
* @classification forms
|
|
43
|
-
* @
|
|
48
|
+
* @example_react
|
|
44
49
|
* ```tsx
|
|
45
50
|
* export default class PageView extends Component {
|
|
46
51
|
* constructor() {
|
|
@@ -61,6 +66,19 @@ declare namespace SwitchProps {
|
|
|
61
66
|
* }
|
|
62
67
|
* }
|
|
63
68
|
* ```
|
|
69
|
+
* @example_vue
|
|
70
|
+
* ```html
|
|
71
|
+
* <template>
|
|
72
|
+
* <view class='components-page'>
|
|
73
|
+
* <text>默认样式</text>
|
|
74
|
+
* <switch :checked="true" />
|
|
75
|
+
* <switch />
|
|
76
|
+
* <text>推荐展示样式</text>
|
|
77
|
+
* <switch :checked="true" />
|
|
78
|
+
* <switch />
|
|
79
|
+
* </view>
|
|
80
|
+
* </template>
|
|
81
|
+
* ```
|
|
64
82
|
* @supported weapp, h5, rn, swan, alipay, tt
|
|
65
83
|
* @see https://developers.weixin.qq.com/miniprogram/dev/component/switch.html
|
|
66
84
|
*/
|