-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from Tencent/docs/swiper
feat(Swiper): support pagination-position
- Loading branch information
Showing
31 changed files
with
620 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const imageCdn = 'https://tdesign.gtimg.com/site/swiper'; | ||
const swiperList = [ | ||
{ | ||
image: `${imageCdn}/01.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/02.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/03.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/04.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/05.png`, | ||
}, | ||
]; | ||
|
||
Component({ | ||
data: { | ||
current: 1, | ||
autoplay: true, | ||
duration: 500, | ||
interval: 5000, | ||
swiperList, | ||
}, | ||
|
||
methods: { | ||
onChange(e) { | ||
const { | ||
detail: { current, source }, | ||
} = e; | ||
console.log(current, source); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-swiper": "tdesign-miniprogram/swiper/swiper", | ||
"t-swiper-item": "tdesign-miniprogram/swiper/swiper-item" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<t-swiper | ||
current="{{current}}" | ||
autoplay="{{autoplay}}" | ||
duration="{{duration}}" | ||
interval="{{interval}}" | ||
bindchange="onChange" | ||
navigation | ||
> | ||
<t-swiper-item wx:for="{{swiperList}}" wx:key="index"> | ||
<image src="{{item.image}}" class="img" /> | ||
</t-swiper-item> | ||
</t-swiper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.img { | ||
width: 100%; | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const imageCdn = 'https://tdesign.gtimg.com/site/swiper'; | ||
const swiperList = [ | ||
{ | ||
image: `${imageCdn}/01.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/02.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/03.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/04.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/05.png`, | ||
}, | ||
]; | ||
|
||
Component({ | ||
data: { | ||
current: 1, | ||
autoplay: true, | ||
duration: 500, | ||
interval: 5000, | ||
swiperList, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-swiper": "tdesign-miniprogram/swiper/swiper", | ||
"t-swiper-item": "tdesign-miniprogram/swiper/swiper-item", | ||
"t-swiper-nav": "tdesign-miniprogram/swiper/swiper-nav" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<t-swiper current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}"> | ||
<t-swiper-item wx:for="{{swiperList}}" wx:key="index"> | ||
<image src="{{item.image}}" class="img" /> | ||
</t-swiper-item> | ||
<!-- 使用插槽组合,可自定义nav组件 --> | ||
<t-swiper-nav slot="nav" type="dots-bar" /> | ||
</t-swiper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.img { | ||
width: 100%; | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const imageCdn = 'https://tdesign.gtimg.com/site/swiper'; | ||
const swiperList = [ | ||
{ | ||
image: `${imageCdn}/01.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/02.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/03.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/04.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/05.png`, | ||
}, | ||
]; | ||
|
||
Component({ | ||
data: { | ||
current: 2, | ||
autoplay: true, | ||
duration: 500, | ||
interval: 5000, | ||
paginationPosition: 'bottom-right', | ||
swiperList, | ||
navigation: { type: 'fraction' }, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-swiper": "tdesign-miniprogram/swiper/swiper", | ||
"t-swiper-item": "tdesign-miniprogram/swiper/swiper-item" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<t-swiper | ||
current="{{current}}" | ||
autoplay="{{autoplay}}" | ||
duration="{{duration}}" | ||
interval="{{interval}}" | ||
navigation="{{navigation}}" | ||
paginationPosition="{{paginationPosition}}" | ||
> | ||
<t-swiper-item wx:for="{{swiperList}}" wx:key="index"> | ||
<image src="{{item.image}}" class="img" /> | ||
</t-swiper-item> | ||
</t-swiper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.img { | ||
width: 100%; | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const imageCdn = 'https://tdesign.gtimg.com/site/swiper'; | ||
const swiperList = [ | ||
{ | ||
image: `${imageCdn}/01.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/02.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/03.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/04.png`, | ||
}, | ||
{ | ||
image: `${imageCdn}/05.png`, | ||
}, | ||
]; | ||
|
||
Component({ | ||
data: { | ||
current: 3, | ||
autoplay: true, | ||
duration: 500, | ||
interval: 5000, | ||
swiperList, | ||
navigation: { type: '', hasNavBtn: true }, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-swiper": "tdesign-miniprogram/swiper/swiper", | ||
"t-swiper-item": "tdesign-miniprogram/swiper/swiper-item" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<t-swiper | ||
current="{{current}}" | ||
autoplay="{{autoplay}}" | ||
duration="{{duration}}" | ||
interval="{{interval}}" | ||
navigation="{{navigation}}" | ||
> | ||
<t-swiper-item wx:for="{{swiperList}}" wx:key="index"> | ||
<image src="{{item.image}}" class="img" /> | ||
</t-swiper-item> | ||
</t-swiper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.img { | ||
width: 100%; | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.