vue怎么实现左右滑动选择日期组件
发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,今天小编给大家分享一下vue怎么实现左右滑动选择日期组件的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们
千家信息网最后更新 2026年11月03日vue怎么实现左右滑动选择日期组件
今天小编给大家分享一下vue怎么实现左右滑动选择日期组件的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。
效果图:
1、安装dayjs日期文件
npm install dayjs --save
2、封装的组件:
{{item}}{{day.value}}
相关的style.css文件
.m-calendar { background: #fff; box-shadow: 0px 2px 6px 0px rgba(183, 183, 183, 0.2);}.m-calendar .m-toolbar { padding-bottom: 0.36266667rem;}.m-calendar .m-toolbar { display: flex; height: 2.56rem;}.m-calendar .m-toolbar .m-month-selector,.m-calendar .m-toolbar .m-year-selector { display: flex; align-items: center; justify-content: space-between; padding-top: 0.74666667rem;}.m-calendar .m-toolbar .m-month-selector,.m-calendar .m-toolbar .m-year-selector { line-height: 1.06666667rem;}.m-calendar .m-toolbar .m-month-selector,.m-calendar .m-toolbar .m-year-selector { font-size: 0.768rem; font-family: PingFangSC-Medium, PingFangSC; font-weight: 500; color: #29262a;}.m-calendar .m-toolbar .m-year-selector { padding-left: 0.91733333rem;}.m-calendar .m-week-header { padding: 0 0.91733333rem;}.m-calendar .m-week-header { padding-bottom: 0.512rem;}.m-calendar .m-week-header { position: relative; display: flex; box-sizing: border-box; justify-content: space-between; font-size: 0.59733333rem;}.m-calendar .m-week-header .m-week-day { text-align: left; line-height: 0.85333333rem; font-family: PingFangSC-Regular, PingFangSC; font-weight: 400; color: #222222;}.m-calendar .m-months-container { position: relative; box-sizing: border-box; height: 12.37333333rem; overflow: hidden;}.m-calendar .m-months-container .m-months-wrapper { position: absolute; top: 0; left: 0; right: 0; bottom: 0;}.m-calendar .m-months-container .m-months-wrapper .m-months { position: absolute; top: 0; left: 0; right: 0; bottom: 0; will-change: transform; width: 16rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row { padding-top: 0.512rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row { width: 16rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row { position: relative; display: flex; height: 1.408rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day { margin-right: 0.87466667rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day:nth-child(1) { margin-left: 0.66133333rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day { font-size: 0.59733333rem; font-family: PingFangSC-Medium, PingFangSC; font-weight: 500; color: #222222;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day { position: relative; height: 1.408rem; width: 1.408rem; line-height: 1.408rem; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 50%;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day .m-day-num { width: 1.408rem; display: inline-block; border-radius: 100%;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day .m-day-num { height: 1.408rem; line-height: 1.408rem;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day .m-grey { color: #b8b8b8;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day .m-today { background: #5DABF3; color: #fff;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day .m-disable { color: #b8b8b8; text-decoration: line-through;}.m-calendar .m-months-container .m-months-wrapper .m-months .m-row .m-day .m-select { background: #007aff; color: #fff;}3、使用到的页面
以上就是"vue怎么实现左右滑动选择日期组件"这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注行业资讯频道。
日期
知识
篇文章
切换
组件
时间
选择
内容
文件
方法
不同
很大
之间
大部分
就是
年份
效果
效果图
更多
月份
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网科技企业
科技类互联网
互联网科技与金融科技
科技制造互联网公司
互联网科技英文
长亮科技互联网金融
左右互联网络科技
安控科技rtu产品工业互联网
温州喔噻互联网科技有限公司
民营互联网公司国防科技
四川慕妮娅互联网科技有限公司
2021互联网科技公司排名
山东大美朱楼互联网科技有限公司
易企秀互联网科技是做什么的
西安有哪些互联网高科技企业
互联网科技手机排行榜
保山互联网科技靠谱吗
互联网时代高科技布局
马化腾互联网科技教学
广州全民伙伴互联网科技有限公司
苏州找大状互联网科技有限公司
新华互联网科技学校
科技互联网项目
科技与互联网
九亚互联网科技
金融科技和互联网金融
福建科技产业互联网发展
威龙国际互联网科技公司
广州千川互联网科技有限公司
工业互联网科技成果转化