網站首頁 編程語言 正文
<template>
<view>
<!--導航欄-->
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="content">設備組詳情</block>
<block slot="right">
<text class="margin-right text-df">編輯</text>
</block>
</cu-custom>
<!--tab欄-->
<scroll-view scroll-x class="bg-blue nav">
<view class="flex text-center justify-around">
<view class="cu-item" :class="index==TabCur?'text-white cur':''" v-for="(item,index) in tabs" :key="index" @tap="tabSelect" :data-id="index">
{{item}}
</view>
</view>
</scroll-view>
<view class="bg-blue" style="height: 5rpx;"></view>
<!--swipe-->
<swiper class="tab-view" ref="swiper1" id="tab-bar-view" :current="tabIndex" :duration="300" @change="onswiperchange">
<swiper-item>
<view class="swiper-item bg-blue">A</view>
</swiper-item>
<swiper-item>
<view class="swiper-item bg-blue">B</view>
</swiper-item>
<swiper-item>
<view class="swiper-item bg-blue">c</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
export default {
data() {
return {
//tab欄
TabCur: 0,
tabs: ['基本信息', '巡檢信息', '巡檢信息1'],
tabIndex: 0,
}
},
onLoad() {
},
methods: {
/*tab欄*/
tabSelect(e) {
console.log("ddd")
console.log(e)
this.TabCur = e.currentTarget.dataset.id;
this.tabIndex = e.currentTarget.dataset.id;
},
onswiperchange(e){
console.log(e)
this.TabCur = e.target.current;
this.tabIndex = e.target.current;
},
}
}
</script>
<style lang="scss">
.ic-add{
font-size: 24rpx;
}
.swiper-item{
height: 500rpx;
}
</style>
其中,tabbar使用colorUI中的nav組件實現。
?完!!!
<template>
<view>
<!--導航欄-->
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="content">設備組詳情</block>
<block slot="right">
<text class="margin-right text-df">編輯</text>
</block>
</cu-custom>
<!--tab欄-->
<scroll-view scroll-x class="bg-blue nav">
<view class="flex text-center justify-around">
<view class="cu-item" :class="index==TabCur?'text-white cur':''" v-for="(item,index) in tabs" :key="index" @tap="tabSelect" :data-id="index">
{{item}}
</view>
</view>
</scroll-view>
<view class="bg-blue" style="height: 5rpx;"></view>
<!--swipe-->
<swiper class="swipe-view" :current="tabIndex" :duration="300" @change="onswiperchange">
<swiper-item>
<basic-info></basic-info>
</swiper-item>
<swiper-item>
<inspection></inspection>
</swiper-item>
</swiper>
</view>
</template>
<script>
import basicInfo from './basic-info/basic-info.vue'
import inspection from './inspection/inspection.vue'
export default {
components:{
inspection,
basicInfo
},
data() {
return {
//tab欄
TabCur: 0,
tabs: ['基本信息', '巡檢信息'],
tabIndex: 0,
}
},
onLoad() {
},
methods: {
/*tab欄*/
tabSelect(e) {
console.log("ddd")
console.log(e)
this.TabCur = e.currentTarget.dataset.id;
this.tabIndex = e.currentTarget.dataset.id;
},
onswiperchange(e){
console.log(e)
this.TabCur = e.target.current;
this.tabIndex = e.target.current;
},
}
}
</script>
<style lang="scss">
.ic-add{
font-size: 24rpx;
}
.swipe-view{
height: calc(100vh - var(--status-bar-height) - 45px - 45px);
}
</style>
原文鏈接:https://ly9527.blog.csdn.net/article/details/123089250
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-04-18 python全面解析接口返回數據_python
- 2022-06-28 詳解Python中遞歸函數的原理與使用_python
- 2022-06-12 C#自定義特性(Attribute)詳解_C#教程
- 2022-06-18 Android實現背景圖滑動變大松開回彈效果_Android
- 2022-04-16 spyder快捷鍵與python符號化輸出方式_python
- 2022-11-06 Nginx如何配置多個服務域名解析共用80端口詳解_nginx
- 2022-12-10 Qt界面中滑動條的實現方式_C 語言
- 2022-05-02 Shell命令中的特殊替換、模式匹配替換、字符串提取和替換的實現_linux shell
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支