I switch pages through the tab bar, but how do I get the title of the switch
as shown in the figure, how do I get the currently selected title, that is, how to get the words "covered rice"
code is as follows:
<scroll-view class="left" >
<block v-for="item in menu" :key="item">
<view class="menuList">
<view class="menu" :class="select==index?"select":""" :data-index="index" @click="turnMenu" >
<p class="name">{{item.typeName}}
<span>(2-6)</span>
</view>
</view>
</block>
</scroll-view>
js
onLoad: function (options) {
var that = this;
wx.request({
url: "https://www.easy-mock.com/mock/596257bc9adc231f357c4664/restaurant/menu",
method: "GET",
success: function (res) {
that.menu=res.data
}
});
},
methods: {
turnMenu(e){
console.log(e)
this.select=e.currentTarget.dataset.index
},
}
ask for advice