uniapp實(shí)現(xiàn)可以左右滑動(dòng)導(dǎo)航欄
本文實(shí)例為大家分享了uniapp實(shí)現(xiàn)左右滑動(dòng)導(dǎo)航欄的具體代碼,供大家參考,具體內(nèi)容如下
<template>
<view>
<home-view></home-view>
<view class="content-box" :id="isScale?'content-box-too':''">
<view class="nav-head-box top-nav-fixed">
<image @click="isScale=!isScale" class="icon-style" src="/static/iconImg/list.png" mode=""></image>
<view style="height: 100%;" class="ft-color-white ft-36 flex-1 flex-wrap align-items-center justify-content-center">
PIQSCORE
</view>
<text style="margin-right: 16upx;" class="iconfont icon-UI_icon_shebeisheshi ft-44 ft-color-red"></text>
<text style="right: 30upx;bottom: 14upx;" class="iconfont icon-UI_icon_shebeisheshi ft-color-red ft-32 position-absolute"></text>
</view>
<view class="m-top-128 top-nav width-100 pd-f-r-36 ft-color-white flex-nowrap space-between position-relative">
<view v-for="(item,index) in 4" :key="index" @click="currentIndex=index" class="top-nav-item">
ALL
</view>
<view :style="'left:'+(currentIndex*164+36)+'upx'" class="position-absolute top-nav-child"></view>
</view>
<swiper style="height: 1122upx;" :current="currentIndex" @change="swiperTab">
<swiper-item v-for="(item,index) in list" :key="index">
<view class="width-100 height-100" style="background: #CCCCCC;">
{{index}}
</view>
</swiper-item>
</swiper>
</view>
</view>
</template>
<script>
export default{
data(){
return{
isScale:false,
currentIndex:0,
list:["ALL","ALL","ALL","ALL"]
}
},
methods:{
swiperTab(e) {
this.currentIndex = e.detail.current //獲取索引
},
}
}
</script>
<style>
.top-nav{
height: 84upx;
background: #008800;
}
.top-nav-item{
width: 168upx;
line-height: 82upx;
text-align: center;
}
.top-nav-child{
left: 0;
bottom: 0;
width: 164upx;
background: #32B53F;
height: 6upx;
transition: all 0.5s;
}
</style>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- uniapp實(shí)現(xiàn)tabs切換(可滑動(dòng))效果實(shí)例
- uniapp組件之tab選項(xiàng)卡滑動(dòng)切換功能實(shí)現(xiàn)
- uniapp使用scroll-view實(shí)現(xiàn)左右上下滑動(dòng)功能
- uniapp小視頻項(xiàng)目開發(fā)之滑動(dòng)播放視頻
- uniapp實(shí)現(xiàn)滑動(dòng)評(píng)分效果
- uniapp開發(fā)小程序?qū)崿F(xiàn)滑動(dòng)頁(yè)面控制元素的顯示和隱藏效果
- uni-app封裝組件實(shí)現(xiàn)下方滑動(dòng)彈出模態(tài)框效果
相關(guān)文章
form.submit()不能提交表單的錯(cuò)誤原因及解決方法
button的id不要設(shè)置為submit,否則可能會(huì)引起混淆,導(dǎo)致表單的submit()方法不能提交表單2014-10-10
bootstrap fileinput 上傳插件的基礎(chǔ)使用
這篇文章主要介紹了bootstrap fileinput 上傳插件基礎(chǔ)使用,重點(diǎn)是把界面做得更加友好,更好的增加用戶體驗(yàn)。對(duì)bootstrap fileinput知識(shí)感興趣的朋友通過(guò)本文一起學(xué)習(xí)吧2017-02-02
通過(guò)高德地圖API獲得某條道路上的所有坐標(biāo)用于描繪道路的方法
這篇文章主要介紹了通過(guò)高德地圖API獲得某條道路上的所有坐標(biāo)用于描繪道路的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-08-08
js簡(jiǎn)單實(shí)現(xiàn)圖片延遲加載的方法
這篇文章主要介紹了js簡(jiǎn)單實(shí)現(xiàn)圖片延遲加載的方法,涉及javascript針對(duì)頁(yè)面元素的遍歷與動(dòng)態(tài)設(shè)置技巧,需要的朋友可以參考下2016-07-07
uni-app低成本封裝一個(gè)取色器組件的簡(jiǎn)單方法
最近想實(shí)現(xiàn)一個(gè)uniapp取色器組件,實(shí)現(xiàn)后發(fā)現(xiàn)效果還不錯(cuò),下面這篇文章主要給大家介紹了關(guān)于uni-app低成本封裝一個(gè)取色器組件的相關(guān)資料,文中通過(guò)圖文介紹的介紹的非常詳細(xì),需要的朋友可以參考下2023-02-02
JavaScript中的canvas?實(shí)現(xiàn)一個(gè)圓環(huán)漸變倒計(jì)時(shí)效果
這篇文章主要介紹了JavaScript中的canvas?實(shí)現(xiàn)一個(gè)圓環(huán)漸變倒計(jì)時(shí)效果,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-09-09

