vue-seamless-scroll插件点击事件失效
<div class="cont" @click="rankBtn($event)">
<vue-seamless-scroll :data="comScoreList" :class-option="classOption" class="table-content">
<ul>
<li v-for="(v, index) in comScoreList" :data="JSON.stringify(v)" :key="index"
class="listRank listItem">
<div class="msg-list">
<div class="msg-left">
<span
:class="index == 0 ? 'drinkdot' : index == 1 ? 'drinkdot' : index == 2 ? 'drinkdot' : 'greydot'">{{
index + 1 }}</span>
<span class="rankName">{{ v.name
|| 0
}}</span>
</div>
<div class="msg-right">
<span class="click-ele">{{
v.platformAmount ? (v.platformAmount / 100).toFixed(2) : 0 }}
</span>
</div>
</div>
</li>
</ul>
</vue-seamless-scroll>
</div>
点击事件
rankBtn(e) {
const path = e.path || (e.composedPath && e.composedPath())
let target = path.filter((r) => /listItem/.test(r.className))
if (target.length) target = target[0]
else return
const data = JSON.parse(target.getAttribute('data'))
this.rankData = data;
},