swiper-anim.uvue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view>
  3. <text>computed属性在设置duration=0的测试:</text>
  4. <swiper :current="current" :vertical="true" duration="0" style="height: 100px; width: 100%;">
  5. <swiper-item v-for="item,index in list" :key="item.id">
  6. <view>
  7. 当前实际渲染的值:{{index}},指定current的值:{{current}}
  8. </view>
  9. </swiper-item>
  10. </swiper>
  11. <text>同时设置autoplay / circular / duration的测试:</text>
  12. <swiper id="swiper-view" :autoplay="true" :interval="3000" :circular="true" :duration="3000" :current="0" style="height: 100px; width: 100%;">
  13. <swiper-item >
  14. <text>0000000000000000000</text>
  15. </swiper-item>
  16. <swiper-item >
  17. <text>111111111111111111</text>
  18. </swiper-item>
  19. </swiper>
  20. </view>
  21. </template>
  22. <script>
  23. export type ListType={
  24. id:number,
  25. content:string
  26. }
  27. export default {
  28. data() {
  29. return {
  30. list:[
  31. {id:1,content:"第一个"},
  32. {id:2,content:"第二个"},
  33. ] as ListType[]
  34. }
  35. },
  36. computed:{
  37. current():number{
  38. return 1
  39. }
  40. },
  41. methods: {
  42. //自动化测试例专用
  43. jest_getWindowInfo() : GetWindowInfoResult {
  44. return uni.getWindowInfo();
  45. }
  46. }
  47. }
  48. </script>
  49. <style>
  50. </style>