perf(ImagePreview): adjust default swipeDuration to 300ms (#7970)

This commit is contained in:
neverland 2021-01-23 11:31:56 +08:00 committed by GitHub
parent b0fb58856c
commit fcb5c223ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -47,7 +47,7 @@ export default createComponent({
},
swipeDuration: {
type: [Number, String],
default: 500,
default: 300,
},
startPosition: {
type: [Number, String],

View File

@ -147,7 +147,7 @@ export default {
| --- | --- | --- | --- |
| images | Images URL list | _string[]_ | `[]` |
| 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-indicators | Whether to show indicators | _boolean_ | `false` |
| loop | Whether to enable loop | _boolean_ | `true` |

View File

@ -161,7 +161,7 @@ export default {
| --- | --- | --- | --- |
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
| startPosition | 图片预览起始位置索引 | _number \| string_ | `0` |
| swipeDuration | 动画时长,单位为`ms` | _number \| string_ | `500` |
| swipeDuration | 动画时长,单位为 `ms` | _number \| string_ | `300` |
| showIndex | 是否显示页码 | _boolean_ | `true` |
| showIndicators | 是否显示轮播指示器 | _boolean_ | `false` |
| loop | 是否开启循环播放 | _boolean_ | `true` |
@ -175,7 +175,7 @@ export default {
| minZoom | 手势缩放时,最小缩放比例 | _number \| string_ | `1/3` |
| closeable | 是否显示关闭图标 | _boolean_ | `false` |
| closeIcon | 关闭图标名称或图片链接 | _string_ | `clear` |
| closeIconPosition | 关闭图标位置,可选值为`top-left`<br>`bottom-left` `bottom-right` | _string_ | `top-right` |
| closeIconPosition | 关闭图标位置,可选值为 `top-left`<br>`bottom-left` `bottom-right` | _string_ | `top-right` |
| teleport | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| Element_ | - |
### Props

View File

@ -19,7 +19,7 @@ const defaultConfig = {
closeIcon: 'clear',
beforeClose: null,
startPosition: 0,
swipeDuration: 500,
swipeDuration: 300,
showIndicators: false,
closeOnPopstate: true,
closeIconPosition: 'top-right',

View File

@ -22,7 +22,7 @@ exports[`should render cover slot correctly 1`] = `
<transition-stub>
<div class="van-popup van-popup--center van-image-preview">
<div class="van-swipe van-image-preview__swipe">
<div style="transition-duration: 500ms; transform: translateX(0px);"
<div style="transition-duration: 300ms; transform: translateX(0px);"
class="van-swipe__track"
>
</div>