加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

基于Vue实现支持按周切换的日历

发布时间:2020-12-17 02:50:58 所属栏目:百科 来源:网络整理
导读:基于Vue的日历小功能,可根据实际开发情况按每年、每月、每周、进行切换,具体内容如下 {{ currentYear }}年{{ currentMonth }}月 一 二 三 四 五 六 日 {{ day.getDate() }} js部分:目前默认显示一周,可根据实际情况更改 div class="jb51code" pre class=

基于Vue的日历小功能,可根据实际开发情况按每年、每月、每周、进行切换,具体内容如下

{{ currentYear }}年{{ currentMonth }}月

    {{ day.getDate() }}

js部分:目前默认显示一周,可根据实际情况更改

<div class="jb51code">
<pre class="brush:js;">

.date {
height: px2rem(180);
color: #333;

.month {
font-size: px2rem(24);
text-align: center;
margin-top: px2rem(20);
}

.weekdays {
display: flex;
font-size: px2rem(28);
margin-top: px2rem(20);

li {
flex: 1;
text-align: center;
}
}

.days {
display: flex;

li {
flex: 1;
font-size: px2rem(30);
text-align: center;
margin-top: px2rem(10);
line-height: px2rem(60);

.active {
 display: inline-block;
 width: px2rem(60);
 height: px2rem(60);
 color: #fff;
 border-radius: 50%;
 background-color: #fa6854;
}

.other-month {
 color: #e4393c;
}

}
}
}

相关参考链接:

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读