Skip to content

Commit

Permalink
feat: mobile-react同步swiper组件
Browse files Browse the repository at this point in the history
  • Loading branch information
xifanTT committed Dec 16, 2024
1 parent ba96285 commit 47eb83a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
54 changes: 54 additions & 0 deletions style/mobile/components/swiper/v2/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@
& > * {
border-radius: @swiper-border-radius;
}

&--image-host {
width: 100%;
height: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
overflow: hidden;
justify-content: center;
position: relative;

& > * {
border-radius: @swiper-border-radius;
}

img {
height: 100%;
width: 100%;
max-width: none;
object-fit: cover;
}
}
}

// 主要容器
Expand All @@ -41,4 +63,36 @@
&--outside {
padding-bottom: @swiper-placement-outside-padding;
}

&__container--card {
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0;
}

&--card {
.@{prefix}-swiper-item {
display: flex;
align-items: center;
box-sizing: border-box;
z-index: 0;
&--active{
z-index: 1;
}
}

.t-swiper-item--image-host {
transition: all 0.3s ease;
}

.t-swiper-item--image-host--prev{
right: @swiper-item-right-padding;
}

.t-swiper-item--image-host--next{
left: @swiper-item-left-padding;
}
}
}
2 changes: 2 additions & 0 deletions style/mobile/components/swiper/v2/_var.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
--td-swiper-placement-outside-padding,
calc(@spacer-1 + @swiper-nav-dot-size)
);
@swiper-item-left-padding: var(--td-swiper-item-left-padding, 6px);
@swiper-item-right-padding: var(--td-swiper-item-right-padding, 6px);

0 comments on commit 47eb83a

Please sign in to comment.