Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/renderless/src/image-viewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export const handleVisible =
state.transform.deg = 0

setTimeout(() => {
if (props.startPosition !== 0) {
if (props.startPosition > 0) {
state.index = (props.startPosition - 1 + state.urlList.length) % state.urlList.length
state.imageTransform = state.index * state.imageItemWidth
state.imageTransformSize = -state.index * state.imageItemWidth
Expand Down Expand Up @@ -481,7 +481,7 @@ export const getImageWidth =
state.imageAllWidth = state.urlList.length * imageW

if (mode !== 'mobile-first') {
if (props.startPosition !== 0) {
if (props.startPosition > 0) {
state.index = props.startPosition
state.imageTransition = 0

Expand Down
2 changes: 1 addition & 1 deletion packages/renderless/src/image-viewer/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const initState = ({ reactive, computed, api, mode, props, constants, inject })
infinite: true,
loading: false,
transform: { scale: 1, deg: 0, offsetX: 0, offsetY: 0, objfit: 'contain', enableTransition: false },
urlList: inject('urlList', null) || props.urlList,
urlList: props.urlList || inject('urlList', null),
mode: constants.MODE.CONTAIN,
previewVisible: props.previewVisible,
fullScreen: props.imageFullCurrent,
Expand Down