-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 修复current动态更新问题 * fix: 更新test * fix: 修复v-model
- Loading branch information
1 parent
3c010b4
commit 15e2dac
Showing
5 changed files
with
199 additions
and
21 deletions.
There are no files selected for viewing
Submodule _common
updated
21 files
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,49 @@ | ||
<template> | ||
<div style="padding: 0 16px"> | ||
<t-swiper | ||
:navigation="{ type: 'dots' }" | ||
:autoplay="true" | ||
:current="current" | ||
@click="handleClick" | ||
@change="handleChange" | ||
> | ||
<t-swiper-item v-for="(item, index) in swiperList" :key="index" style="height: 192px"> | ||
<img :src="item" class="img" /> | ||
</t-swiper-item> | ||
</t-swiper> | ||
<div class="tdesign-demo-block-row"> | ||
<t-button size="small" theme="primary" @click="current = current + 2 > 5 ? 0 : current + 1"> | ||
跳转到第 {{ current + 2 >= 6 ? 1 : current + 2 }} 项 | ||
</t-button> | ||
</div> | ||
</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
const imageCdn = 'https://tdesign.gtimg.com/mobile/demos'; | ||
const swiperList = [ | ||
`${imageCdn}/swiper1.png`, | ||
`${imageCdn}/swiper2.png`, | ||
`${imageCdn}/swiper1.png`, | ||
`${imageCdn}/swiper2.png`, | ||
`${imageCdn}/swiper1.png`, | ||
]; | ||
const current = ref(0); | ||
const handleChange = (index: number, context: any) => { | ||
console.log('基础示例,页数变化到》》》', index, context); | ||
}; | ||
const handleClick = (value: number) => { | ||
console.log('click: ', value); | ||
}; | ||
</script> | ||
|
||
<style> | ||
img { | ||
display: block; | ||
width: 100%; | ||
height: 192px; | ||
} | ||
</style> |
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