html:
<ul id="optionList">
<li class="listItem vux-1px-b" id="myWallet" @:click="itemClk">
<p class="icon"><img src="@/assets/images/icon/icon9.png">
<p class="text">
<p class="arrow"><img src="@/assets/images/icon/r_arrow.png">
</li>
<li class="listItem vux-1px-b" id="order" @click="itemClk">
<p class="icon"><img src="@/assets/images/icon/icon1.png">
<p class="text">
<p class="arrow"><img src="@/assets/images/icon/r_arrow.png">
</li>
<li class="listItem vux-1px-b" id="cooperation" @click="itemClk">
<p class="icon"><img src="@/assets/images/icon/icon8.png">
<p class="text">
<p class="arrow"><img src="@/assets/images/icon/r_arrow.png">
</li>
</ul>
js:
methods: {
itemClk (e) {
let thisId = e.target.id
this.$router.push(thisId)
}
},
effect picture:
:li
li
id
:li
li
id
icon
li
in this way, you can"t directly get id
of li
, so I"d like to ask everyone how when binding a click event to li
, click li
to always get the li
element, instead of getting its child element
(try @ click.stop
is useless.)