Skip to content

feat: RN swiper组件支持display-multiple-items属性#2403

Open
Blackgan3 wants to merge 1 commit intomasterfrom
feat-support-swiper-display-items
Open

feat: RN swiper组件支持display-multiple-items属性#2403
Blackgan3 wants to merge 1 commit intomasterfrom
feat-support-swiper-display-items

Conversation

@Blackgan3
Copy link
Collaborator

RN swiper组件支持display-multiple-items属性

const children = Array.isArray(props.children) ? props.children.filter(child => child) : (props.children ? [props.children] : [])
// 默认前后补位的元素个数
const patchElmNum = circular ? (preMargin ? 2 : 1) : 0
const patchElmNum = (circular && children.length > 1) ? displayMultipleItems + 1 : 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preMargin的判断完全丢弃了

const dir = horizontal === false ? 'y' : 'x'
const pstep = dir === 'x' ? initWidth : initHeight
const initStep: number = isNaN(pstep) ? 0 : pstep
const initStep: number = isNaN(pstep) ? 0 : pstep / displayMultipleItems
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step保持容器宽度后续方便处理一些吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants