mobileclient/v1_5_0_C/tabbar.js

44 lines
942 B
JavaScript
Raw Normal View History

2022-09-21 18:35:54 +08:00
const tabComponent = {
2022-09-21 17:30:39 +08:00
template: `
2022-09-21 18:35:54 +08:00
<ul class="tabList">
<li v-for="item in tabComponent.list" :key="item.id" @click='tabComponent.iconHandler(item)'>
<img :src="current===item.id?item.checkedSrc:item.src" alt="">
<p>{{item.text}}</p>
</li>
</ul>`,
props: {
current: {
type: Number,
default: 1
2022-09-21 17:30:39 +08:00
}
2022-09-21 18:35:54 +08:00
},
list: [
{
id: 1,
src: "./img/home.png",
checkedSrc: "./img/checked_home.png",
link: "./couponCollection.html",
text: "首页"
},
{
id: 2,
src: "./img/order.png",
checkedSrc: "./img/checked_order.png",
link: "./myOrder.html",
text: "订单"
},
{
id: 3,
src: "./img/coupon.png",
checkedSrc: "./img/checked_coupon.png",
link: "./myCoupon.html",
text: "我的券"
}
],
iconHandler(item) {
window.location.replace(item.link)
2022-09-21 17:30:39 +08:00
}
2022-09-21 18:35:54 +08:00
}