当前位置:网站首页>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
边栏推荐
- How to use jedis of redis
- [array]566 Reshape the matrix - simple
- 面试汇总:这是一份全面&详细的Android面试指南
- [software reverse - basic knowledge] analysis method, assembly instruction architecture
- 我就一写代码的,王总整天和我谈格局...
- [brush questions] BFS topic selection
- Excuse me, my request is a condition update, but it is blocked in the buffer. In this case, can I only flush the cache every time?
- 优先使用对象组合,而不是类继承
- Delphi free memory
- JWT漏洞复现
猜你喜欢
About the recent experience of writing questions
On the day 25K joined Tencent, I cried
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?
Multimedia query
[C language] address book - dynamic and static implementation
[groovy] string (string type variable definition | character type variable definition)
[groovy] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
The new project Galaxy token just announced by coinlist is gal
An elegant program for Euclid‘s algorithm
随机推荐
【无标题】
The new project Galaxy token just announced by coinlist is gal
postman和postman interceptor的安装
一文带你了解BI的前世今身与企业数字化转型的关系
[web source code code code audit method] audit skills and tools
Some enterprise interview questions of unity interview
DECLARE_ WAIT_ QUEUE_ HEAD、wake_ up_ Interruptible macro analysis
Redis之Jedis如何使用
provide/inject
[positioning in JS]
Technology sharing swift defense programming
How is the entered query SQL statement executed?
阿里云ECS使用cloudfs4oss挂载OSS
[wp][入门]刷弱类型题目
Smart pointer shared_ PTR and weak_ Difference of PTR
Monitoring web performance with performance
汇编-入门
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
线程基础知识
Plasticscm enterprise crack