当前位置:网站首页>3. Package the bottom navigation tabbar
3. Package the bottom navigation tabbar
2022-07-05 03:56:00 【Justion_】
New component Tabbar
And introduce Home On the page

edit Tabbar Components
<template>
<div class="tabbr">
<ul>
<li
v-for="(item, index) in routerList"
:key="index"
@click="switchTab(item.path)"
>
<img
:src="$route.path.includes(item.path) ? item.selected : item.active"
alt=""
/>
<span :class="$route.path.includes(item.path) ? 'active' : ''">{
{
item.title
}}</span>
</li>
</ul>
</div>
</template>
<script>
export default {
data() {
return {
routerList: [
{
title: " home page ",
path: "/home",
active: "./images/home_default.png",
selected: "./images/home_selected.png",
},
{
title: " classification ",
path: "/list",
active: "./images/category_default.png",
selected: "./images/category_selected.png",
},
{
title: " The shopping cart ",
path: "/cart",
active: "./images/shoppingcart_default.png",
selected: "./images/shoppingcart_selected.png",
},
{
title: " my ",
path: "/my",
active: "./images/mine_default.png",
selected: "./images/mine_selected.png",
},
],
};
},
methods: {
switchTab(path) {
// Determine whether the same route is clicked
if (this.$route.path == path) return;
// Corresponding jump page
this.$router.replace(path);
},
},
};
</script>
<style scoped >
.tabbr {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
z-index: 999;
height: 1.3333rem;
background-color: #fff;
}
.tabbr ul {
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
height: 100%;
}
.tabbr ul li {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.tabbr ul li img {
width: 0.8267rem;
height: 0.8267rem;
}
.tabbr ul li span {
font-size: 16px;
}
.active {
color: green;
}
</style>
Home page Home Set redirection
边栏推荐
- [wp][introduction] brush weak type questions
- On the day 25K joined Tencent, I cried
- [groovy] string (string splicing | multi line string)
- ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
- An elegant program for Euclid‘s algorithm
- [groovy] string (string type variable definition | character type variable definition)
- Enterprise level: spire Office for . NET:Platinum|7.7. x
- [web Audit - source code disclosure] obtain source code methods and use tools
- 花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
- 汇编-入门
猜你喜欢

error Couldn‘t find a package. JSON file in "your path“

Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?

C # use awaiter
![[luat-air105] 4.1 file system FS](/img/5e/7fdeedaef420736d761f4a681cd2d8.jpg)
[luat-air105] 4.1 file system FS

Why do some programmers change careers before they are 30?

An elegant program for Euclid‘s algorithm

【软件逆向-基础知识】分析方法、汇编指令体系结构

【web審計-源碼泄露】獲取源碼方法,利用工具

Basic function learning 02

On the day 25K joined Tencent, I cried
随机推荐
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
输入的查询SQL语句,是如何执行的?
Nmap使用手册学习记录
@Transactional 注解导致跨库查询失效的问题
grandMA2 onPC 3.1.2.5的DMX参数摸索
Binary heap implementation (priority queue implementation)
@The problem of cross database query invalidation caused by transactional annotation
How is the entered query SQL statement executed?
[PHP features - variable coverage] improper use, improper configuration and code logic vulnerability of the function
Clickhouse materialized view
An elegant program for Euclid‘s algorithm
Timing manager based on C #
程序员的视力怎么样? | 每日趣闻
MindFusion.Virtual Keyboard for WPF
C语言课设:影院售票管理系统
How rem is used
Thread Basics
postman和postman interceptor的安装
error Couldn‘t find a package. JSON file in "your path“
[positioning in JS]