如何利用element-ui框架中的el-calendar日历组件做一些自定义的修改,比如纪念日之类的,下面web建站小编给大家介绍一下代码的使用方法。
代码示例:
<el-calendar v-model="value" id="calendar">
<!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
<template
slot="dateCell"
slot-scope="{date, data}">
<!--自定义内容-->
<div>
<div class="calendar-day">{{ data.day.split('-').slice(2).join('-') }}</div>
<div v-for="item in calendarData">
<div v-if="(item.months).indexOf(data.day.split('-').slice(1)[0])!=-1">
<div v-if="(item.days).indexOf(data.day.split('-').slice(2).join('-'))!=-1">
<el-tooltip class="item" effect="dark" :content="item.things" placement="right">
<div class="is-selected">{{item.things}}</div>
</el-tooltip>
</div>
<div v-else></div>
</div>
<div v-else></div>
</div>
</div>
</template>
</el-calendar>
<script>
export default {
name: "calendar",
data(){
return {
calendarData: [
{ months: ['09', '11'],days: ['15'],things: '看电影' },
{ months: ['10', '11'], days: ['02'],things: '去公园野炊' },
{ months: ['11'], days: ['02'],things: '看星星' },
{ months: ['11'], days: ['02'],things: '看月亮' }
],
value: new Date()
}
}
}
</script>
<style>
.calendar-day{
text-align: center;
color: #202535;
line-height: 30px;
font-size: 12px;
}
.is-selected{
color: #F8A535;
font-size: 10px;
margin-top: 5px;
}
#calendar .el-button-group>.el-button:not(:first-child):not(:last-child):after{
content: '当月';
}
</style>
上面是“el-calendar日历组件自定义使用方法介绍”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2461.html
workflows工作流
一只由粉色水晶与羽毛组成的巨型高跟鞋
一座古老的石阶,旁边有一棵树
水晶玉雕巨龙ComfyUI工作流
一位漂亮的女人坐在樱花树旁
一只精致透明的朱红色水晶狐狸
在森林中心有一座蛇形的房子ComfyUI工作流
小孩手握锤子顽皮搞笑卡通3d形象
树上挂着一只表情可爱的香蕉ComfyUI工作流二
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

3d文字动画效果
利用CSS3做一个星级评分样式
jquery做一个漂亮挂墙动态时钟
用canvas实现画板涂鸦效果
日历设置每个月颜色都不一样
iframe开发admin后台
利用js+css3做一个小鱼游泳特效
纯html+css做一个3d统计效果







