首页> Uniapp教程
uniapp实现可以左右滑动导航栏
withpy
2021-06-02
简介这篇文章主要为大家详细介绍了uniapp 实现可以左右滑动导航栏,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实例为大家分享了uniapp实现左右滑动导航栏的具体代码,供大家参考,具体内容如下
<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>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持本站。
相关文章
-
pymysql实现增删改查的操作指南(python)
python中可以使用pymysql来MySQL数据库的连接,并实现数据库的各种操作,这篇文章主要给大家介绍了关于pymsql实现增删改查的相关资料,需要的朋友可以参考下
-
屏蔽Django admin界面添加按钮的操作
这篇文章主要介绍了屏蔽Django admin界面添加按钮的操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
-
shiro整合springboot前后端分离
这篇文章主要介绍了shiro整合springboot前后端分离,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
-
python遍历文件夹,指定遍历深度与忽略目录的方法
今天小编就为大家分享一篇python遍历文件夹,指定遍历深度与忽略目录的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
-
Python中的上下文管理器和with语句的使用
本篇文章主要介绍了Python中的上下文管理器和with语句的使用,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
-
vue select二级联动第二级默认选中第一个option值的实例
下面小编就为大家分享一篇vue select二级联动第二级默认选中第一个option值的实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧