Click event on mpvue img is invalid

problem description

the basic function is to click on the picture to jump to another page, but the bound event is useless and does not execute the binding event

the environmental background of the problems and what methods you have tried

I tried to bind with @ click.native, but it didn"t work;
also tried to bread a layer of div outside the img and then bind the event to the div. Here is the code bound to the div

related codes

/ / Please paste the code text below (do not replace the code with pictures)
< template >
< div class= "siwperContainer" >

<swiper indicator-dots="true" autoplay="true" circular="true">
  <div v-for="(book,idx) in top9Books" :key="idx">
    <swiper-item class="si">
      <div @click.native="bookDetail">
        <img :src="book.image" mode="aspectFit" class="swiperImg">
      </div>
    </swiper-item>
  </div>
</swiper>

< / div >
< / template >

< script >
export default {
props: ["top9Books"],
computed: {

imgUrls () {
  let res = this.top9Books
  return [res.slice(0, 3), res.slice(3, 6), res.slice(6)]
}

},
methods: {

bookDetail () {
  console.log("click img")
  wx.navigateTo({
    url: "/pages/detail/main?id=" + 15
  })
}

}
}
< / script >

< style >
.swiperContainer {
margin-top: 5px;
}
.si {
display: flex;
flex-direction: row;
}
.si div {
width: 33%;
height: 100%;
}
.swiperImg {
width: 100%;
height: 100%;
}
< / style >

what result do you expect? What is the error message actually seen?

Jun.23,2021

Honey, are you done? It's almost 4 o'clock for me to mess with this pit. No, no, no. For now, the temporary solution is to put @ click on the < image > component. If you put it on img or div, you won't respond if you click on it.


try removing native from @ click.native .


Don't call swiper in the component. Use it directly in index.vue. The tap event is OK, and personal testing is available

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e503b2-44010.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e503b2-44010.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?