当前位置:网站首页>快应用底部导航栏
快应用底部导航栏
2022-04-22 05:45:00 【礼礼。】


代码如下:
<template>
<div class="wrapper">
<!-- tab导航 -->
<div class="fix-bar">
<!-- 首页 -->
<div class="bar index" @click="tabClick('Index')">
<image
class="img"
src="/assets/img/shouye{
{numIndex}}.png"
style="object-fit: contain"
></image>
<text class="text-index">首页</text>
</div>
<!-- 咨讯 -->
<div class="bar setting" @click="tabClick('News')">
<image
class="img"
src="/assets/img/news{
{numNews}}.png"
style="object-fit: contain"
></image>
<text class="text-index">资讯</text>
</div>
<!-- 我的 -->
<div class="bar setting" @click="tabClick('Mine')">
<image
class="img"
src="/assets/img/wode{
{numMine}}.png"
style="object-fit: contain"
></image>
<text class="text-index">我的</text>
</div>
</div>
</div>
</template>
<script>
import router from '@system.router'
export default {
data: {
numIndex: 1,
numNews: 0,
numMine: 0,
},
onInit() {
let pageName = this.$page.currentPageName || this.$page.name
if (pageName === "pages/Index") {
this.numIndex = 1
this.numMine = 0
this.numNews = 0
} else if (pageName === "pages/News") {
this.numIndex = 0
this.numMine = 0
this.numNews = 1
} else if (pageName === "pages/Mine" || pageName === "pages/Setting" || pageName === "pages/Login") {
this.numIndex = 0
this.numMine = 1
this.numNews = 0
}
},
tabClick(type) {
router.replace({
uri: "pages/" + type
})
}
}
</script>
<style lang="less">
.wrapper {
width: 100%;
display: flex;
flex-flow: row wrap;
flex-direction: column; /*纵向排列 */
background: linear-gradient(
to right,
rgb(156, 203, 241) 500px,
rgb(254, 255, 255) 99%
);
.fix-bar {
height: 100px;
position: fixed;
bottom: 0px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
background-color: #ffffff;
border-top: 1px solid #ccc;
.bar {
width: 33%;
justify-content: center;
flex-direction: column;
align-items: center;
}
.img {
width: 32px;
height: 32px;
}
.text-index {
color: rgba(54, 54, 54, 1);
font-size: 20px;
}
}
}
</style>
版权声明
本文为[礼礼。]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_45736311/article/details/123550873
边栏推荐
猜你喜欢

STL学习笔记0x0001(容器分类)

Leetcode: Sword finger offer 29 Print the matrix clockwise

Installation of QT learning

Record the pit of ad software learning

deep learning object detection

算数和逻辑操作

QToolButtom、QPushButtom添加QMenu后去掉右下角三角图标

IWDG

关于手眼标定中RT矩阵的欧拉角和Halcon中pose的类型之间的关系

Geojson file ShapeFile file batch conversion gadget
随机推荐
FILE写入数据到本地
QSslSocket::connectToHostEncrypted: TLS initialization failed
写一个函数的声明,使其返回数组的引用并且该数组包含10个string对象(笔记)
Rtl8367 learning note 2 - network configuration operation literacy
Pykmip test
Dynamic memory management, file operation, preprocessing
2020-10-28
常见面试问题 - 1(非技术)
指针所指的地址值及指针所指对象的值(学习笔记)
Geojson file and ShapeFile file single conversion gadget
On the relationship between the Euler angle of RT matrix and the type of pose in Halcon in hand eye calibration
Blue Bridge Cup embedded expansion board learning lis302dl
Characteristics and usage of QT signal and slot
Heap basic operation source code Bing
线程内容学习
膨胀腐蚀以及其它形态学处理
LeetCode: 322. Change exchange (dynamic programming, recursion, memo recursion and backtracking)
《C语言程序设计现代方法》阅读笔记
Leetcode: Sword finger offer 29 Print the matrix clockwise
qt Debug版本运行正常Release版本运行奔溃