mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-23 18:00:27 +08:00
perf(ImagePreview): adjust default swipe duration to 300ms (#7973)
This commit is contained in:
parent
3351f8a07a
commit
c532be87ff
@ -54,7 +54,7 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
swipeDuration: {
|
swipeDuration: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 500,
|
default: 300,
|
||||||
},
|
},
|
||||||
startPosition: {
|
startPosition: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
|
@ -117,7 +117,7 @@ export default {
|
|||||||
| showIndex | Whether to show index | _boolean_ | `true` |
|
| showIndex | Whether to show index | _boolean_ | `true` |
|
||||||
| showIndicators | Whether to show indicators | _boolean_ | `false` |
|
| showIndicators | Whether to show indicators | _boolean_ | `false` |
|
||||||
| loop | Whether to enable loop | _boolean_ | `true` |
|
| loop | Whether to enable loop | _boolean_ | `true` |
|
||||||
| swipeDuration | Animation duration (ms) | _number \| string_ | `500` |
|
| swipeDuration | Animation duration (ms) | _number \| string_ | `300` |
|
||||||
| onClose | Emitted when ImagePreview is closed | _Function_ | - |
|
| onClose | Emitted when ImagePreview is closed | _Function_ | - |
|
||||||
| onChange | Emitted when current image changed | _Function_ | - |
|
| onChange | Emitted when current image changed | _Function_ | - |
|
||||||
| onScale | Emitted when scaling current image | _Function_ | - |
|
| onScale | Emitted when scaling current image | _Function_ | - |
|
||||||
@ -137,7 +137,7 @@ export default {
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| images | Images URL list | _string[]_ | `[]` |
|
| images | Images URL list | _string[]_ | `[]` |
|
||||||
| start-position | Start position | _number \| string_ | `0` |
|
| start-position | Start position | _number \| string_ | `0` |
|
||||||
| swipe-duration | Animation duration (ms) | _number \| string_ | `500` |
|
| swipe-duration | Animation duration (ms) | _number \| string_ | `300` |
|
||||||
| show-index | Whether to show index | _boolean_ | `true` |
|
| show-index | Whether to show index | _boolean_ | `true` |
|
||||||
| show-indicators | Whether to show indicators | _boolean_ | `false` |
|
| show-indicators | Whether to show indicators | _boolean_ | `false` |
|
||||||
| loop | Whether to enable loop | _boolean_ | `true` |
|
| loop | Whether to enable loop | _boolean_ | `true` |
|
||||||
|
@ -150,7 +150,7 @@ export default {
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
|
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
|
||||||
| startPosition | 图片预览起始位置索引 | _number \| string_ | `0` |
|
| startPosition | 图片预览起始位置索引 | _number \| string_ | `0` |
|
||||||
| swipeDuration | 动画时长,单位为`ms` | _number \| string_ | `500` |
|
| swipeDuration | 动画时长,单位为`ms` | _number \| string_ | `300` |
|
||||||
| showIndex | 是否显示页码 | _boolean_ | `true` |
|
| showIndex | 是否显示页码 | _boolean_ | `true` |
|
||||||
| showIndicators | 是否显示轮播指示器 | _boolean_ | `false` |
|
| showIndicators | 是否显示轮播指示器 | _boolean_ | `false` |
|
||||||
| loop | 是否开启循环播放 | _boolean_ | `true` |
|
| loop | 是否开启循环播放 | _boolean_ | `true` |
|
||||||
@ -175,7 +175,7 @@ export default {
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
|
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
|
||||||
| start-position | 图片预览起始位置索引 | _number \| string_ | `0` |
|
| start-position | 图片预览起始位置索引 | _number \| string_ | `0` |
|
||||||
| swipe-duration | 动画时长,单位为 ms | _number \| string_ | `500` |
|
| swipe-duration | 动画时长,单位为 ms | _number \| string_ | `300` |
|
||||||
| show-index | 是否显示页码 | _boolean_ | `true` |
|
| show-index | 是否显示页码 | _boolean_ | `true` |
|
||||||
| show-indicators | 是否显示轮播指示器 | _boolean_ | `false` |
|
| show-indicators | 是否显示轮播指示器 | _boolean_ | `false` |
|
||||||
| loop | 是否开启循环播放 | _boolean_ | `true` |
|
| loop | 是否开启循环播放 | _boolean_ | `true` |
|
||||||
|
@ -19,7 +19,7 @@ const defaultConfig = {
|
|||||||
asyncClose: false,
|
asyncClose: false,
|
||||||
getContainer: 'body',
|
getContainer: 'body',
|
||||||
startPosition: 0,
|
startPosition: 0,
|
||||||
swipeDuration: 500,
|
swipeDuration: 300,
|
||||||
showIndicators: false,
|
showIndicators: false,
|
||||||
closeOnPopstate: true,
|
closeOnPopstate: true,
|
||||||
closeIconPosition: 'top-right',
|
closeIconPosition: 'top-right',
|
||||||
|
@ -42,7 +42,7 @@ exports[`index slot 1`] = `
|
|||||||
exports[`render image 1`] = `
|
exports[`render image 1`] = `
|
||||||
<div class="van-image-preview" name="van-fade">
|
<div class="van-image-preview" name="van-fade">
|
||||||
<div class="van-swipe van-image-preview__swipe">
|
<div class="van-swipe van-image-preview__swipe">
|
||||||
<div class="van-swipe__track" style="transition-duration: 500ms; transform: translateX(0px);">
|
<div class="van-swipe__track" style="transition-duration: 300ms; transform: translateX(0px);">
|
||||||
<div class="van-swipe-item van-image-preview__swipe-item"></div>
|
<div class="van-swipe-item van-image-preview__swipe-item"></div>
|
||||||
<div class="van-swipe-item van-image-preview__swipe-item"></div>
|
<div class="van-swipe-item van-image-preview__swipe-item"></div>
|
||||||
<div class="van-swipe-item van-image-preview__swipe-item"></div>
|
<div class="van-swipe-item van-image-preview__swipe-item"></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user