完成我的成长脚印UI
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const activeTab = ref("member");
|
||||
|
||||
const tabs = [
|
||||
{ id: "member", image: "../static/tab-vip.png" },
|
||||
{ id: "growth", image: "../static/tab-grow.png" },
|
||||
{ id: "shop", image: "../static/tab-mall.png" },
|
||||
{ image: "../static/tab-vip.png" },
|
||||
{ image: "../static/tab-grow.png" },
|
||||
{ image: "../static/tab-mall.png" },
|
||||
];
|
||||
|
||||
function handleTabClick(tabId) {
|
||||
activeTab.value = tabId;
|
||||
function handleTabClick(index) {
|
||||
if (index === 1) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/my-growth",
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -19,10 +19,9 @@ function handleTabClick(tabId) {
|
||||
<image class="footer-bg" src="../static/tab-bg.png" mode="widthFix" />
|
||||
<view
|
||||
v-for="(tab, index) in tabs"
|
||||
:key="tab.id"
|
||||
:key="index"
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === tab.id }"
|
||||
@click="handleTabClick(tab.id)"
|
||||
@click="handleTabClick(index)"
|
||||
>
|
||||
<image
|
||||
:src="tab.image"
|
||||
|
||||
Reference in New Issue
Block a user