当前位置: 首页 > news >正文

底部Taber的抽取

1.会抽取一个布局样式
2.布局样式里面抽取一个底部样式
在这里插入图片描述
这个是layout的代码

<template><view class="layout-wrapper"><view class="layout-content"><slot></slot></view><!-- 底部 --><Tabbar :activeIndex="activeIndex"></Tabbar></view>
</template><script>import Tabbar from './tabbar.vue'export default {name:"layout",props: ['activeIndex'],components: {Tabbar},data() {return {};}}
</script><style lang="scss">.layout-wrapper {width: 100vw;height: 100vh;.layout-content {height: calc(100vh - 120rpx);overflow-y: auto;}}
</style>

这个是底部的代码

<template><view class="tabbar-wrapper"><text v-for="(item, index) in tabbarList" :key="item.pagePath" @click="clickTabbar(item)":class="{active: index === activeIndex}">{{ item.text }} - {{ activeIndex }}</text></view>
</template><script>export default {props: ['activeIndex'],data() {return {tabbarList: [{pagePath: '/pages/xingqing/xingqing',text: '心情'},{pagePath: '/pages/add/add',text: '加号'},{pagePath: '/pages/my/my',text: '我的'},]}},methods: {clickTabbar(item) {uni.switchTab({url: item.pagePath})}}}
</script><style>.tabbar-wrapper {height: 120rpx;width: 100%;border-top: 1px solid red;box-sizing: border-box;}.active {color: red;}
</style>

记住要配置taberbar 然后在app。vue里面隐藏就好了
在这里插入图片描述

http://www.lryc.cn/news/187281.html

相关文章:

  • Bootstrap中固定某一个元素不随滚动条滚动
  • 时序数据库 IoTDB 发布端边云原生解决方案,有效优化工业互联网数据上传时效与资源消耗...
  • Spring Boot中实现发送文本、带附件和HTML邮件
  • MySQL5.7版本与8.0版本在CentOS系统安装
  • 【gitlab】从其他仓库创建项目
  • 【ARM CoreLink 系列 6 -- DMC-400控制器简介】
  • 在 Azure 中开发云原生应用程序:工具和技巧
  • 【Redis】基础数据结构-字典
  • 平板第三方电容笔怎么样?便宜的ipad触控笔推荐
  • pytorch_神经网络构建3
  • 遗传算法入门笔记
  • 【golang】go 返回参数 以及go中 裸返
  • elasticsearch深度分页问题
  • 32、Flink table api和SQL 之用户自定义 Sources Sinks实现及详细示例
  • Java练习题-用冒泡排序法实现数组排序
  • 【SV中的多线程fork...join/join_any/join_none】
  • 翻译:网站整站翻译 / 网站国际化 / 极简实现
  • 深度森林(deep-forest)安装
  • ping.pe ping 检测IP全球延迟
  • nodejs 16版本
  • NSSCTF做题(7)
  • 【GIT版本控制】--高级分支策略
  • 【Qt控件之QDialog】使用及技巧
  • Transformer预测 | Python实现基于Transformer的股票价格预测(tensorflow)
  • spark sql如何行转列
  • Prompt-Tuning(一)
  • 域信息收集
  • MySQ 学习笔记
  • pdf文档内容提取pdfplumber、PyPDF2
  • 运算符