uniapp实现可以左右滑动导航栏
编程学习 2021-07-04 14:06www.dzhlxh.cn编程入门
这篇文章主要为大家详细介绍了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>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持狼蚁SEO。
上一篇:js 图片懒加载的实现
下一篇:解决vue-loader加载不上的问题
编程语言
- ThinkPad 笔记本如何调节LCD屏幕亮度
- Dreamweaver制作网页打开特效教程
- Win10 Mobile 10586升级后无限重启怎么办 硬重启帮您
- Win8系统提示音频设备有问题有一个或多个音频服
- Xbox One版Win10首个预览版9月份发布
- 如何在textarea文本输入区内实现换行
- Win10 Build 9901系统更新 预览版新版本下载
- McAfee Framework存在远程格式串处理漏洞
- Win10家庭版今日(7月30)正式在中国官方商城开卖
- Win10 Mobile预览版更新完10536.1000后才收到10536.100
- Win10 RS2更新了什么-Win10 RS2最终版本号1704首曝
- Windows7如何查看回收站对应的文件夹有哪些方法
- Win10让Charms栏回归桌面的方法教程
- 取消Windows XP系统开机启动画面的小技巧
- win8系统怎么下载安装USB百兆网卡?
- XP系统下磁盘空间变少了怎么办?XP系统磁盘空间