fix: use $index in event args, drop unsupported swiper ref (build success)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<swiper class="swiper" ref="swiper" index="{{currentIndex}}" indicator="false" loop="false"
|
||||
<swiper class="swiper" index="{{currentIndex}}" indicator="false" loop="false"
|
||||
previousmargin="14px" nextmargin="14px" onchange="onSwipeChange">
|
||||
<!-- 左页:会话 -->
|
||||
<div class="page-item left-page">
|
||||
<text class="page-title">会话</text>
|
||||
<div class="session-list">
|
||||
<div class="session-row" for="{{sessions}}" onclick="selectSession({{$index}})">
|
||||
<div class="session-row" for="{{sessions}}" onclick="selectSession($index)">
|
||||
<text class="session-title">{{$item.title}}</text>
|
||||
<text class="session-dot" if="{{$item.running}}">●</text>
|
||||
</div>
|
||||
@@ -94,10 +94,8 @@ export default {
|
||||
},
|
||||
|
||||
goTo(index) {
|
||||
// index 属性绑定已驱动 swiper 切换;此处主要同步 data
|
||||
this.currentIndex = index
|
||||
if (this.$refs && this.$refs.swiper && this.$refs.swiper.swipeTo) {
|
||||
this.$refs.swiper.swipeTo({ index })
|
||||
}
|
||||
},
|
||||
|
||||
selectSession(index) {
|
||||
|
||||
Reference in New Issue
Block a user