1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <view>
- <text>computed属性在设置duration=0的测试:</text>
- <swiper :current="current" :vertical="true" duration="0" style="height: 100px; width: 100%;">
- <swiper-item v-for="item,index in list" :key="item.id">
- <view>
- 当前实际渲染的值:{{index}},指定current的值:{{current}}
- </view>
- </swiper-item>
- </swiper>
- <text>同时设置autoplay / circular / duration的测试:</text>
- <swiper id="swiper-view" :autoplay="true" :interval="3000" :circular="true" :duration="3000" :current="0" style="height: 100px; width: 100%;">
- <swiper-item >
- <text>0000000000000000000</text>
- </swiper-item>
- <swiper-item >
- <text>111111111111111111</text>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- export type ListType={
- id:number,
- content:string
- }
- export default {
- data() {
- return {
- list:[
- {id:1,content:"第一个"},
- {id:2,content:"第二个"},
- ] as ListType[]
- }
- },
- computed:{
- current():number{
- return 1
- }
- },
- methods: {
- //自动化测试例专用
- jest_getWindowInfo() : GetWindowInfoResult {
- return uni.getWindowInfo();
- }
- }
- }
- </script>
- <style>
- </style>
|