vue3+element-plus实现日历组件农历显示且带列表数据

在这里插入图片描述
calendar.js
https://gitee.com/mirrors/calendar-js.git 这个js可以去下载,里面涉及的有点多

要设置日历每周以周一开始,需要在main.js中加入这一行代码
在这里插入图片描述

import 'dayjs/locale/zh-cn'; // 设置日历每周从周一开始
<template>
 <ELPlusLanguageConfig :local="local">
	<el-calendar v-model="newData" class="dialog-calendar">
	 <template #header="{ date }">
	     <div class="font18" style="color: var(--color6)">{
   {
    date }}</div>
	     <div class="view-btn">
	       <span class="pointer active">单期查看</span>
	       <span @click="goPage('/DataWrite/DataEditCompare',{id:123,c:true})" class="pointer">
	         对比查看
	       </span>
	     </div>
	 </template>
	 <template #dateCell="{ date, data }">
	   <el-row>
	     <el-col class="datastyle">
	       <span>{
   {
    data.day.split("-").slice(2).join("-") }}</span>
	       <span class="marginL10">{
   {
    solarToLunar(date, data) }}</span>
	     </el-col>
	   </el-row>
	   <template v-for="(item, index) in textContent(data.day)" :key="index">
	     <div v-for="(list, ind) in item.list.slice(0, 4)" :key="ind" class="paddingV5 item-list ellipsis">{
   {
    list.name }}</div>
	     <!-- 每个日期下面最多显示4条填报信息,超过4条显示分页 -->
	     <div v-if="item.list.length > 4" class="flex items-center justify-end">
	       <div class="marginR10 item-page">
	         <span styl
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值