前端vue可以左右滚动的切换的tabs tabs选项卡 滑动动画效果 自动宽度, 下载完整代码请访问https://ext.dcloud.net.cn/plugin?id=13003

效果图如下:

 

 

 

 

#### 使用方法

```使用方法

swiperTabList: ["2023-06-10","2023-06-11","2023-06-12","2023-06-13","2023-06-14","2023-06-15"], //导航列表

swiperTabIdx: 0,

swiperColor: '#161616', //导航栏字体未选中前颜色

swiperCurrentColor: '#1D63FF', //选中当前导航栏字体颜色

curSwiperWidth: '26%', //当前导航的宽度 % upx rpx px  (导航超出可左右滑动 )

curSwiperHeight: 96, //当前导航的高度度 rpx px

curSwiperLineShow: true, //是否显示导航栏的线条 (线条距离标题太近的话可自行修改.swiperLine的css)

curSwiperLineActiveBg: '#1D63FF', //当前选中的导航栏线条颜色

curSwiperLineActiveWidth: '60%', //当前选中的导航栏线条的宽度 upx rpx px

curSwiperLineActiveHeight: '2px', //当前选中的导航栏线条的高度度 upx rpx px

<!--组件-->

<ccSwiperTabs :swiperTabList='swiperTabList' :swiperTabIdx='swiperTabIdx'

:curSwiperWidth='curSwiperWidth' :curSwiperHeight='curSwiperHeight' :swiperColor='swiperColor'

:swiperCurrentColor='swiperCurrentColor' :curSwiperLineShow="curSwiperLineShow"

:curSwiperLineActiveWidth="curSwiperLineActiveWidth" :curSwiperLineActiveHeight="curSwiperLineActiveHeight"

:curSwiperLineActiveBg="curSwiperLineActiveBg"

@change="CurrentTab">

</ccSwiperTabs>

```

#### HTML代码部分

```html

<template>

<view class="content">

<!--组件-->

<ccSwiperTabs :swiperTabList='swiperTabList' :swiperTabIdx='swiperTabIdx'

:curSwiperWidth='curSwiperWidth' :curSwiperHeight='curSwiperHeight' :swiperColor='swiperColor'

:swiperCurrentColor='swiperCurrentColor' :curSwiperLineShow="curSwiperLineShow"

:curSwiperLineActiveWidth="curSwiperLineActiveWidth" :curSwiperLineActiveHeight="curSwiperLineActiveHeight"

:curSwiperLineActiveBg="curSwiperLineActiveBg"

@change="CurrentTab">

</ccSwiperTabs>

<!-- radioData:单选数据 curIndex:当前选择序列 @change:单选事件 -->

<ccRadioView :radioData="items" :curIndex="current" @change="radioChange"></ccRadioView>

<button class="submitBtn" type="primary" @click="submitAppointment">提交预约</button>

</view>

</template>

```

#### JS代码 (引入组件 填充数据)

```javascript

<script>

import ccSwiperTabs from '../../components/ccSwiperTabs.vue'

import ccRadioView from '../../components/ccRadioView.vue'

export default {

components: {

ccSwiperTabs,

ccRadioView

},

data() {

return {

swiperTabList: ["2023-06-10","2023-06-11","2023-06-12","2023-06-13","2023-06-14","2023-06-15"], //导航列表

swiperTabIdx: 0,

swiperColor: '#161616', //导航栏字体未选中前颜色

swiperCurrentColor: '#1D63FF', //选中当前导航栏字体颜色

curSwiperWidth: '26%', //当前导航的宽度 % upx rpx px  (导航超出可左右滑动 )

curSwiperHeight: 96, //当前导航的高度度 rpx px

curSwiperLineShow: true, //是否显示导航栏的线条 (线条距离标题太近的话可自行修改.swiperLine的css)

curSwiperLineActiveBg: '#1D63FF', //当前选中的导航栏线条颜色

curSwiperLineActiveWidth: '60%', //当前选中的导航栏线条的宽度 upx rpx px

curSwiperLineActiveHeight: '2px', //当前选中的导航栏线条的高度度 upx rpx px

items: [{

value: '1',

name: '上午9:00-10:00'

},

{

value: '2',

name: '上午10:00-11:00',

checked: ''

},

{

value: '3',

name: '上午11:00-12:00',

},

{

value: '4',

name: '下午13:00-14:00',

},

{

value: '5',

name: '下午14:00-15:00',

},

{

value: '6',

name: '下午15:00-16:00',

},

{

value: '7',

name: '下午16:00-17:00',

},

{

value: '8',

name: '下午17:00-18:00',

},

],

current: 0,

}

},

onLoad() {

},

methods: {

submitAppointment(){

uni.showModal({

title:'预约数据',

content:"日期选择 = " + this.swiperTabList[this.swiperTabIdx] + "  时间段选择 = " + this.items[this.current].name

})

},

//tab点击事件 自行完善需要的代码

CurrentTab: function(index, item) {

this.swiperTabIdx = index;

console.log('日期选择' + item + '\n序列' + index)

},

radioChange: function(evt) {

for (let i = 0; i < this.items.length; i++) {

if (this.items[i].value === evt.target.value) {

this.current = i;

break;

}

}

},

}

}

</script>

```

#### CSS

```css

<style>

.content {

display: flex;

flex-direction: column;

}

.submitBtn {

width: 90%;

margin-top: 86rpx;

}

</style>

```

前端vue可以左右滚动的切换的tabs tabs选项卡 滑动动画效果 自动宽度的更多相关文章

  1. vue中多个元素或多个组件之间的动画效果

    多个元素的过渡 <style> .v-enter,.v-leave-to{ opacity: 0; } .v-enter-acitve,.v-leave-active{ opacity: ...

  2. vue实现ajax滚动下拉加载,同时具有loading效果

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  3. vue动画效果出现重叠,并且出现滚动条

    背景 使用 vue 结合 animated css 第三方动画样式,简单地给页面组件加上切换时的 fade 淡入/淡出动画效果 当调试效果时发现,展示效果出现了问题,并且出现滚动条 原因 退场动画还没 ...

  4. Windows Phone使用sliverlight toolkit实现页面切换动画效果

    使用应用时,好多app在页面切换的时候都有一个动画效果,感觉很炫,也大大增加了用户体验,怎么实现呢? 界面的切换,可以用Windows Phone Toolkit中的TransitionService ...

  5. js鼠标滚轮滚动图片切换效果

    效果体验网址:http://keleyi.com/keleyi/phtml/image/12.htm HTML文件代码: <!DOCTYPE html PUBLIC "-//W3C// ...

  6. Web前端-Vue.js必备框架(四)

    Web前端-Vue.js必备框架(四) 计算属性: <div id="aaa"> {{ message.split('').reverse().join('') }} ...

  7. 前端Vue知识小白

    感觉是已好久没写博文了.今日难得有时间,便写一篇文章.此文章是关于前端知识的,我本身是后端,因工作或其他需要,便学习了前端Vue.此文章是在菜鸟教程上学习的.那么下面进入正文! 首先,Vue.js是一 ...

  8. [前端] VUE基础 (6) (v-router插件、获取原生DOM)

    一.v-router插件 1.v-router插件介绍 v-router是vue的一个核心插件,vue+vue-router主要用来做SPA(单页面应用)的. 什么是SPA:就是在一个页面中,有多个页 ...

  9. vue监听滚动事件,实现滚动监听

    在vue中实现滚动监听和原生js无太大差异,下面是一个简单的demo,可在控制台查看结果 <!DOCTYPE html> <html lang="en"> ...

  10. Web前端-Vue.js必备框架(五)

    Web前端-Vue.js必备框架(五) 页面组件,商品列表组件,详情组件,购物车清单组件,结算页组件,订单详情组件,订单列表组件. vue-router 路由 vuex 组件集中管理 webpack ...

随机推荐

  1. [ACM]Uva839-Not So Mobile(树状天平)

    在输入过程中同时进行数据处理,代码简洁,效率较高 #include<iostream> #include<cstdio> using namespace std; bool s ...

  2. 一步步制作下棋机器人之 coppeliasim进行Scara机械臂仿真与python控制

    稚晖君又发布了新的机器人,很是强大. 在编写时看到了稚晖君的招聘信息,好想去试试啊! 小时候都有一个科幻梦,如今的职业也算与梦想有些沾边了.但看到稚晖君这种闪着光芒的作品,还是很是羡慕. 以前就想做一 ...

  3. 在线编写Markdown

    部署 editor.md 实现在线编写MD 安装Nginx服务 apt install nginx yum install nginx 修改Nginx配置 root@cby:~# vim /etc/n ...

  4. Linux文件系统故障,Input/output error

    事情是这样的,在启动某一个应用程序的时候,出现 Input/output error 的报错,磁盘以及目录无法使用的情况下,进行了重启,重启完成后是可以正常使用的,过一段时间后就会再次出现这个问题,一 ...

  5. Prometheus+Grafana监控系统

    Prometheus vs Zabbix Zabbix的客户端更多是只做上报的事情,push模式.而Prometheus则是客户端本地也会存储监控数据,服务端定时来拉取想要的数据. Zabbix的客户 ...

  6. 一篇博客上手request和response

    概念 request:获取请求数据 response:设置响应数据 Request request继承体系 ServletRequest--Java提供的请求对象根接口 HttpServletRequ ...

  7. java-io FileInputStream文件拷贝

    1.编写代码 main方法: public static void main(String[] args) throws IOException { String pathFileUrl =" ...

  8. [Pytorch框架] 5.3 Fashion MNIST进行分类

    文章目录 5.3 Fashion MNIST进行分类 Fashion MNIST 介绍 数据集介绍 分类 格式 数据提交 数据加载 创建网络 损失函数 优化器 开始训练 训练后操作 可视化损失函数 保 ...

  9. .NET开源分布式锁DistributedLock

    一.线程锁和分布式锁 线程锁通常在单个进程中使用,以防止多个线程同时访问共享资源. 在我们.NET中常见的线程锁有: 自旋锁:当线程尝试获取锁时,它会重复执行一些简单的指令,直到锁可用 互斥锁: Mu ...

  10. Python-HwTestReport的简单使用

    一.工具包下载 https://github.com/hongweifuture/HwTestReport(出自此大神) 二.使用示例(直接上代码) 1.将 HwTestReport.py 导入项目 ...