v-calendar 日历组件使用自定义提示内容

news2024/11/25 1:00:12

目录

0.介绍

1.安装v-calendar

2.页面使用

3.使用插槽实现待办数量的标记


0.介绍

最近项目中用到了日历插件,需要统计每天的任务数量,类似elementui的badge组件,待办任务数量

大概最后的效果如下图所示,右上角把代办任务数量展示出来

vue的日历相关组件挺多的,选了v-calendar,后期翻API有点难受,中文版不太好找,简单记录下。

1.安装v-calendar

npm i --save v-calendar

我的是vue2,最后下载的的版本是

直接全局引入

import VCalendar from 'v-calendar'; // 引入日历插件

Vue.use(VCalendar, {
  componentPrefix: 'vc'
}); // 组件前缀,以防后期跟其他冲突

2.页面使用

ps:“vc-”就是在引入时候的追加的前缀

<vc-calendar :attributes="attrs" class="calendar"/>

数据结构如下 

attrs: [
        {
          key: 'v0Day',
          dates: new Date(),
          highlight: true,
          dot: true,
          popover: {
            label: '美好的一天!要开心呦!'
          }
        },
        {
          key: 'V1Day',
          customData: '10',
          dot: {
            style: {
              backgroundColor: 'red'
            }
          },
          dates: new Date(2023, 10, 18),
          popover: {
            label: '美好的一天!要开心呦!'
          }
        },
        {
          key: 'V2Day',
          customData: '9',
          dates: new Date(2023, 10, 6)
        }
      ],

官网关于attributes数据结构介绍如下图

运行效果图如下所示,标记过的日期(设置过dot)的都有一个小圆点。

3.使用插槽实现待办数量的标记

但是跟目标:日期又上角有对应的代办数量有点差距,看了下API,关于#day-content插槽介绍

结合attributes数据中customData属性,可以利用插槽实现最后待办标记的效果

贴代码,根据实际情况自定义customData,可以是字符串、数组或者对象,实际应用中有且止有一个数量,所以我就直接拿设置了字符串,页面获取也是直接写死了。

<vc-calendar :attributes="attrs" class="calendar">
   <template #day-content="{ day }">
        <span tabindex="-1" :aria-label="day.ariaLabel" :aria-disabled="day.isDisabled"
               role="button"
               class="vc-day-content vc-focusable"
               >{{ day.day }}</span>
                  <span class="v-custom-dot"
                        v-if="day.attributes?.length>0&&day.attributes[0]?.customData"
                  >{{ day.attributes[0].customData }}</span>
  </template>
</vc-calendar>

关于插槽中{day}的数据结构,截取了标注过的2023-11-18的这天,内容如下,在day.attributes属性中,我们可以拿到之前设置的customData值,所以就可以灵活配置了~

{
  "id": "2023-11-18",
  "label": "18",
  "ariaLabel": "2023年11月18日星期六",
  "day": 18,
  "dayFromEnd": 13,
  "weekday": 7,
  "weekdayPosition": 6,
  "weekdayPositionFromEnd": 1,
  "weekdayOrdinal": 3,
  "weekdayOrdinalFromEnd": 2,
  "week": 3,
  "weekFromEnd": 3,
  "weeknumber": 47,
  "isoWeeknumber": 46,
  "month": 11,
  "year": 2023,
  "date": "2023-11-17T16:00:00.000Z",
  "range": {
    "start": "2023-11-17T16:00:00.000Z",
    "end": "2023-11-18T15:59:59.999Z"
  },
  "isToday": false,
  "isFirstDay": false,
  "isLastDay": false,
  "inMonth": true,
  "inPrevMonth": false,
  "inNextMonth": false,
  "onTop": false,
  "onBottom": false,
  "onLeft": false,
  "onRight": false,
  "classes": [
    "id-2023-11-18",
    "day-18",
    "day-from-end-13",
    "weekday-7",
    "weekday-position-6",
    "weekday-ordinal-3",
    "weekday-ordinal-from-end-2",
    "week-3",
    "week-from-end-3",
    {
      "is-today": false,
      "is-first-day": false,
      "is-last-day": false,
      "in-month": true,
      "in-prev-month": false,
      "in-next-month": false,
      "on-top": false,
      "on-bottom": false,
      "on-left": false,
      "on-right": false
    }
  ],
  "isDisabled": false,
  "isFocusable": false,
  "refresh": false,
  "attributesMap": {
    "V1Day": {
      "key": "V1Day",
      "hashcode": 83582020,
      "customData": "10",
      "order": 0,
      "dateOpts": {
        "order": 0,
        "locale": {
          "id": "zh-CN",
          "daysInWeek": 7,
          "firstDayOfWeek": 2,
          "masks": {
            "L": "YYYY/MM/DD",
            "title": "MMMM YYYY",
            "weekdays": "W",
            "navMonths": "MMM",
            "input": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "inputDateTime": [
              "L h:mm A",
              "YYYY-MM-DD h:mm A",
              "YYYY/MM/DD h:mm A"
            ],
            "inputDateTime24hr": [
              "L HH:mm",
              "YYYY-MM-DD HH:mm",
              "YYYY/MM/DD HH:mm"
            ],
            "inputTime": [
              "h:mm A"
            ],
            "inputTime24hr": [
              "HH:mm"
            ],
            "dayPopover": "WWW, MMM D, YYYY",
            "data": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "iso": "YYYY-MM-DDTHH:mm:ss.SSSZ"
          },
          "dayNames": [
            "星期日",
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六"
          ],
          "dayNamesShort": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesShorter": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesNarrow": [
            "日",
            "一",
            "二",
            "三",
            "四",
            "五",
            "六"
          ],
          "monthNames": [
            "一月",
            "二月",
            "三月",
            "四月",
            "五月",
            "六月",
            "七月",
            "八月",
            "九月",
            "十月",
            "十一月",
            "十二月"
          ],
          "monthNamesShort": [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月"
          ],
          "amPm": [
            "am",
            "pm"
          ],
          "monthData": {
            "11-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 4,
              "days": 30,
              "weeks": 5,
              "month": 11,
              "year": 2023,
              "weeknumbers": [
                45,
                46,
                47,
                48,
                49
              ],
              "isoWeeknumbers": [
                44,
                45,
                46,
                47,
                48
              ]
            },
            "10-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 1,
              "days": 31,
              "weeks": 6,
              "month": 10,
              "year": 2023,
              "weeknumbers": [
                40,
                41,
                42,
                43,
                44,
                45
              ],
              "isoWeeknumbers": [
                39,
                40,
                41,
                42,
                43,
                44
              ]
            },
            "12-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 6,
              "days": 31,
              "weeks": 5,
              "month": 12,
              "year": 2023,
              "weeknumbers": [
                49,
                50,
                51,
                52,
                53
              ],
              "isoWeeknumbers": [
                48,
                49,
                50,
                51,
                52
              ]
            },
            "1-2020": {
              "firstDayOfWeek": 2,
              "inLeapYear": true,
              "firstWeekday": 4,
              "days": 31,
              "weeks": 5,
              "month": 1,
              "year": 2020,
              "weeknumbers": [
                1,
                2,
                3,
                4,
                5
              ],
              "isoWeeknumbers": [
                1,
                2,
                3,
                4,
                5
              ]
            }
          }
        }
      },
      "popover": {
        "label": "美好的一天!要开心呦!"
      },
      "dates": [
        {
          "isDateInfo": true,
          "order": 0,
          "locale": {
            "id": "zh-CN",
            "daysInWeek": 7,
            "firstDayOfWeek": 2,
            "masks": {
              "L": "YYYY/MM/DD",
              "title": "MMMM YYYY",
              "weekdays": "W",
              "navMonths": "MMM",
              "input": [
                "L",
                "YYYY-MM-DD",
                "YYYY/MM/DD"
              ],
              "inputDateTime": [
                "L h:mm A",
                "YYYY-MM-DD h:mm A",
                "YYYY/MM/DD h:mm A"
              ],
              "inputDateTime24hr": [
                "L HH:mm",
                "YYYY-MM-DD HH:mm",
                "YYYY/MM/DD HH:mm"
              ],
              "inputTime": [
                "h:mm A"
              ],
              "inputTime24hr": [
                "HH:mm"
              ],
              "dayPopover": "WWW, MMM D, YYYY",
              "data": [
                "L",
                "YYYY-MM-DD",
                "YYYY/MM/DD"
              ],
              "iso": "YYYY-MM-DDTHH:mm:ss.SSSZ"
            },
            "dayNames": [
              "星期日",
              "星期一",
              "星期二",
              "星期三",
              "星期四",
              "星期五",
              "星期六"
            ],
            "dayNamesShort": [
              "周日",
              "周一",
              "周二",
              "周三",
              "周四",
              "周五",
              "周六"
            ],
            "dayNamesShorter": [
              "周日",
              "周一",
              "周二",
              "周三",
              "周四",
              "周五",
              "周六"
            ],
            "dayNamesNarrow": [
              "日",
              "一",
              "二",
              "三",
              "四",
              "五",
              "六"
            ],
            "monthNames": [
              "一月",
              "二月",
              "三月",
              "四月",
              "五月",
              "六月",
              "七月",
              "八月",
              "九月",
              "十月",
              "十一月",
              "十二月"
            ],
            "monthNamesShort": [
              "1月",
              "2月",
              "3月",
              "4月",
              "5月",
              "6月",
              "7月",
              "8月",
              "9月",
              "10月",
              "11月",
              "12月"
            ],
            "amPm": [
              "am",
              "pm"
            ],
            "monthData": {
              "11-2023": {
                "firstDayOfWeek": 2,
                "inLeapYear": false,
                "firstWeekday": 4,
                "days": 30,
                "weeks": 5,
                "month": 11,
                "year": 2023,
                "weeknumbers": [
                  45,
                  46,
                  47,
                  48,
                  49
                ],
                "isoWeeknumbers": [
                  44,
                  45,
                  46,
                  47,
                  48
                ]
              },
              "10-2023": {
                "firstDayOfWeek": 2,
                "inLeapYear": false,
                "firstWeekday": 1,
                "days": 31,
                "weeks": 6,
                "month": 10,
                "year": 2023,
                "weeknumbers": [
                  40,
                  41,
                  42,
                  43,
                  44,
                  45
                ],
                "isoWeeknumbers": [
                  39,
                  40,
                  41,
                  42,
                  43,
                  44
                ]
              },
              "12-2023": {
                "firstDayOfWeek": 2,
                "inLeapYear": false,
                "firstWeekday": 6,
                "days": 31,
                "weeks": 5,
                "month": 12,
                "year": 2023,
                "weeknumbers": [
                  49,
                  50,
                  51,
                  52,
                  53
                ],
                "isoWeeknumbers": [
                  48,
                  49,
                  50,
                  51,
                  52
                ]
              },
              "1-2020": {
                "firstDayOfWeek": 2,
                "inLeapYear": true,
                "firstWeekday": 4,
                "days": 31,
                "weeks": 5,
                "month": 1,
                "year": 2020,
                "weeknumbers": [
                  1,
                  2,
                  3,
                  4,
                  5
                ],
                "isoWeeknumbers": [
                  1,
                  2,
                  3,
                  4,
                  5
                ]
              }
            }
          },
          "firstDayOfWeek": 2,
          "start": "2023-11-17T16:00:00.000Z",
          "startTime": 1700236800000,
          "end": "2023-11-17T16:00:00.000Z",
          "endTime": 1700236800000,
          "isDate": true,
          "isRange": false,
          "isComplex": false
        }
      ],
      "hasDates": true,
      "excludeDates": [],
      "hasExcludeDates": false,
      "excludeMode": "intersects",
      "isComplex": false,
      "targetDate": {
        "isDateInfo": true,
        "order": 0,
        "locale": {
          "id": "zh-CN",
          "daysInWeek": 7,
          "firstDayOfWeek": 2,
          "masks": {
            "L": "YYYY/MM/DD",
            "title": "MMMM YYYY",
            "weekdays": "W",
            "navMonths": "MMM",
            "input": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "inputDateTime": [
              "L h:mm A",
              "YYYY-MM-DD h:mm A",
              "YYYY/MM/DD h:mm A"
            ],
            "inputDateTime24hr": [
              "L HH:mm",
              "YYYY-MM-DD HH:mm",
              "YYYY/MM/DD HH:mm"
            ],
            "inputTime": [
              "h:mm A"
            ],
            "inputTime24hr": [
              "HH:mm"
            ],
            "dayPopover": "WWW, MMM D, YYYY",
            "data": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "iso": "YYYY-MM-DDTHH:mm:ss.SSSZ"
          },
          "dayNames": [
            "星期日",
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六"
          ],
          "dayNamesShort": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesShorter": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesNarrow": [
            "日",
            "一",
            "二",
            "三",
            "四",
            "五",
            "六"
          ],
          "monthNames": [
            "一月",
            "二月",
            "三月",
            "四月",
            "五月",
            "六月",
            "七月",
            "八月",
            "九月",
            "十月",
            "十一月",
            "十二月"
          ],
          "monthNamesShort": [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月"
          ],
          "amPm": [
            "am",
            "pm"
          ],
          "monthData": {
            "11-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 4,
              "days": 30,
              "weeks": 5,
              "month": 11,
              "year": 2023,
              "weeknumbers": [
                45,
                46,
                47,
                48,
                49
              ],
              "isoWeeknumbers": [
                44,
                45,
                46,
                47,
                48
              ]
            },
            "10-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 1,
              "days": 31,
              "weeks": 6,
              "month": 10,
              "year": 2023,
              "weeknumbers": [
                40,
                41,
                42,
                43,
                44,
                45
              ],
              "isoWeeknumbers": [
                39,
                40,
                41,
                42,
                43,
                44
              ]
            },
            "12-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 6,
              "days": 31,
              "weeks": 5,
              "month": 12,
              "year": 2023,
              "weeknumbers": [
                49,
                50,
                51,
                52,
                53
              ],
              "isoWeeknumbers": [
                48,
                49,
                50,
                51,
                52
              ]
            },
            "1-2020": {
              "firstDayOfWeek": 2,
              "inLeapYear": true,
              "firstWeekday": 4,
              "days": 31,
              "weeks": 5,
              "month": 1,
              "year": 2020,
              "weeknumbers": [
                1,
                2,
                3,
                4,
                5
              ],
              "isoWeeknumbers": [
                1,
                2,
                3,
                4,
                5
              ]
            }
          }
        },
        "firstDayOfWeek": 2,
        "start": "2023-11-17T16:00:00.000Z",
        "startTime": 1700236800000,
        "end": "2023-11-17T16:00:00.000Z",
        "endTime": 1700236800000,
        "isDate": true,
        "isRange": false,
        "isComplex": false
      }
    }
  },
  "attributes": [
    {
      "key": "V1Day",
      "hashcode": 83582020,
      "customData": "10",
      "order": 0,
      "dateOpts": {
        "order": 0,
        "locale": {
          "id": "zh-CN",
          "daysInWeek": 7,
          "firstDayOfWeek": 2,
          "masks": {
            "L": "YYYY/MM/DD",
            "title": "MMMM YYYY",
            "weekdays": "W",
            "navMonths": "MMM",
            "input": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "inputDateTime": [
              "L h:mm A",
              "YYYY-MM-DD h:mm A",
              "YYYY/MM/DD h:mm A"
            ],
            "inputDateTime24hr": [
              "L HH:mm",
              "YYYY-MM-DD HH:mm",
              "YYYY/MM/DD HH:mm"
            ],
            "inputTime": [
              "h:mm A"
            ],
            "inputTime24hr": [
              "HH:mm"
            ],
            "dayPopover": "WWW, MMM D, YYYY",
            "data": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "iso": "YYYY-MM-DDTHH:mm:ss.SSSZ"
          },
          "dayNames": [
            "星期日",
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六"
          ],
          "dayNamesShort": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesShorter": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesNarrow": [
            "日",
            "一",
            "二",
            "三",
            "四",
            "五",
            "六"
          ],
          "monthNames": [
            "一月",
            "二月",
            "三月",
            "四月",
            "五月",
            "六月",
            "七月",
            "八月",
            "九月",
            "十月",
            "十一月",
            "十二月"
          ],
          "monthNamesShort": [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月"
          ],
          "amPm": [
            "am",
            "pm"
          ],
          "monthData": {
            "11-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 4,
              "days": 30,
              "weeks": 5,
              "month": 11,
              "year": 2023,
              "weeknumbers": [
                45,
                46,
                47,
                48,
                49
              ],
              "isoWeeknumbers": [
                44,
                45,
                46,
                47,
                48
              ]
            },
            "10-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 1,
              "days": 31,
              "weeks": 6,
              "month": 10,
              "year": 2023,
              "weeknumbers": [
                40,
                41,
                42,
                43,
                44,
                45
              ],
              "isoWeeknumbers": [
                39,
                40,
                41,
                42,
                43,
                44
              ]
            },
            "12-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 6,
              "days": 31,
              "weeks": 5,
              "month": 12,
              "year": 2023,
              "weeknumbers": [
                49,
                50,
                51,
                52,
                53
              ],
              "isoWeeknumbers": [
                48,
                49,
                50,
                51,
                52
              ]
            },
            "1-2020": {
              "firstDayOfWeek": 2,
              "inLeapYear": true,
              "firstWeekday": 4,
              "days": 31,
              "weeks": 5,
              "month": 1,
              "year": 2020,
              "weeknumbers": [
                1,
                2,
                3,
                4,
                5
              ],
              "isoWeeknumbers": [
                1,
                2,
                3,
                4,
                5
              ]
            }
          }
        }
      },
      "popover": {
        "label": "美好的一天!要开心呦!"
      },
      "dates": [
        {
          "isDateInfo": true,
          "order": 0,
          "locale": {
            "id": "zh-CN",
            "daysInWeek": 7,
            "firstDayOfWeek": 2,
            "masks": {
              "L": "YYYY/MM/DD",
              "title": "MMMM YYYY",
              "weekdays": "W",
              "navMonths": "MMM",
              "input": [
                "L",
                "YYYY-MM-DD",
                "YYYY/MM/DD"
              ],
              "inputDateTime": [
                "L h:mm A",
                "YYYY-MM-DD h:mm A",
                "YYYY/MM/DD h:mm A"
              ],
              "inputDateTime24hr": [
                "L HH:mm",
                "YYYY-MM-DD HH:mm",
                "YYYY/MM/DD HH:mm"
              ],
              "inputTime": [
                "h:mm A"
              ],
              "inputTime24hr": [
                "HH:mm"
              ],
              "dayPopover": "WWW, MMM D, YYYY",
              "data": [
                "L",
                "YYYY-MM-DD",
                "YYYY/MM/DD"
              ],
              "iso": "YYYY-MM-DDTHH:mm:ss.SSSZ"
            },
            "dayNames": [
              "星期日",
              "星期一",
              "星期二",
              "星期三",
              "星期四",
              "星期五",
              "星期六"
            ],
            "dayNamesShort": [
              "周日",
              "周一",
              "周二",
              "周三",
              "周四",
              "周五",
              "周六"
            ],
            "dayNamesShorter": [
              "周日",
              "周一",
              "周二",
              "周三",
              "周四",
              "周五",
              "周六"
            ],
            "dayNamesNarrow": [
              "日",
              "一",
              "二",
              "三",
              "四",
              "五",
              "六"
            ],
            "monthNames": [
              "一月",
              "二月",
              "三月",
              "四月",
              "五月",
              "六月",
              "七月",
              "八月",
              "九月",
              "十月",
              "十一月",
              "十二月"
            ],
            "monthNamesShort": [
              "1月",
              "2月",
              "3月",
              "4月",
              "5月",
              "6月",
              "7月",
              "8月",
              "9月",
              "10月",
              "11月",
              "12月"
            ],
            "amPm": [
              "am",
              "pm"
            ],
            "monthData": {
              "11-2023": {
                "firstDayOfWeek": 2,
                "inLeapYear": false,
                "firstWeekday": 4,
                "days": 30,
                "weeks": 5,
                "month": 11,
                "year": 2023,
                "weeknumbers": [
                  45,
                  46,
                  47,
                  48,
                  49
                ],
                "isoWeeknumbers": [
                  44,
                  45,
                  46,
                  47,
                  48
                ]
              },
              "10-2023": {
                "firstDayOfWeek": 2,
                "inLeapYear": false,
                "firstWeekday": 1,
                "days": 31,
                "weeks": 6,
                "month": 10,
                "year": 2023,
                "weeknumbers": [
                  40,
                  41,
                  42,
                  43,
                  44,
                  45
                ],
                "isoWeeknumbers": [
                  39,
                  40,
                  41,
                  42,
                  43,
                  44
                ]
              },
              "12-2023": {
                "firstDayOfWeek": 2,
                "inLeapYear": false,
                "firstWeekday": 6,
                "days": 31,
                "weeks": 5,
                "month": 12,
                "year": 2023,
                "weeknumbers": [
                  49,
                  50,
                  51,
                  52,
                  53
                ],
                "isoWeeknumbers": [
                  48,
                  49,
                  50,
                  51,
                  52
                ]
              },
              "1-2020": {
                "firstDayOfWeek": 2,
                "inLeapYear": true,
                "firstWeekday": 4,
                "days": 31,
                "weeks": 5,
                "month": 1,
                "year": 2020,
                "weeknumbers": [
                  1,
                  2,
                  3,
                  4,
                  5
                ],
                "isoWeeknumbers": [
                  1,
                  2,
                  3,
                  4,
                  5
                ]
              }
            }
          },
          "firstDayOfWeek": 2,
          "start": "2023-11-17T16:00:00.000Z",
          "startTime": 1700236800000,
          "end": "2023-11-17T16:00:00.000Z",
          "endTime": 1700236800000,
          "isDate": true,
          "isRange": false,
          "isComplex": false
        }
      ],
      "hasDates": true,
      "excludeDates": [],
      "hasExcludeDates": false,
      "excludeMode": "intersects",
      "isComplex": false,
      "targetDate": {
        "isDateInfo": true,
        "order": 0,
        "locale": {
          "id": "zh-CN",
          "daysInWeek": 7,
          "firstDayOfWeek": 2,
          "masks": {
            "L": "YYYY/MM/DD",
            "title": "MMMM YYYY",
            "weekdays": "W",
            "navMonths": "MMM",
            "input": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "inputDateTime": [
              "L h:mm A",
              "YYYY-MM-DD h:mm A",
              "YYYY/MM/DD h:mm A"
            ],
            "inputDateTime24hr": [
              "L HH:mm",
              "YYYY-MM-DD HH:mm",
              "YYYY/MM/DD HH:mm"
            ],
            "inputTime": [
              "h:mm A"
            ],
            "inputTime24hr": [
              "HH:mm"
            ],
            "dayPopover": "WWW, MMM D, YYYY",
            "data": [
              "L",
              "YYYY-MM-DD",
              "YYYY/MM/DD"
            ],
            "iso": "YYYY-MM-DDTHH:mm:ss.SSSZ"
          },
          "dayNames": [
            "星期日",
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六"
          ],
          "dayNamesShort": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesShorter": [
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六"
          ],
          "dayNamesNarrow": [
            "日",
            "一",
            "二",
            "三",
            "四",
            "五",
            "六"
          ],
          "monthNames": [
            "一月",
            "二月",
            "三月",
            "四月",
            "五月",
            "六月",
            "七月",
            "八月",
            "九月",
            "十月",
            "十一月",
            "十二月"
          ],
          "monthNamesShort": [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月"
          ],
          "amPm": [
            "am",
            "pm"
          ],
          "monthData": {
            "11-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 4,
              "days": 30,
              "weeks": 5,
              "month": 11,
              "year": 2023,
              "weeknumbers": [
                45,
                46,
                47,
                48,
                49
              ],
              "isoWeeknumbers": [
                44,
                45,
                46,
                47,
                48
              ]
            },
            "10-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 1,
              "days": 31,
              "weeks": 6,
              "month": 10,
              "year": 2023,
              "weeknumbers": [
                40,
                41,
                42,
                43,
                44,
                45
              ],
              "isoWeeknumbers": [
                39,
                40,
                41,
                42,
                43,
                44
              ]
            },
            "12-2023": {
              "firstDayOfWeek": 2,
              "inLeapYear": false,
              "firstWeekday": 6,
              "days": 31,
              "weeks": 5,
              "month": 12,
              "year": 2023,
              "weeknumbers": [
                49,
                50,
                51,
                52,
                53
              ],
              "isoWeeknumbers": [
                48,
                49,
                50,
                51,
                52
              ]
            },
            "1-2020": {
              "firstDayOfWeek": 2,
              "inLeapYear": true,
              "firstWeekday": 4,
              "days": 31,
              "weeks": 5,
              "month": 1,
              "year": 2020,
              "weeknumbers": [
                1,
                2,
                3,
                4,
                5
              ],
              "isoWeeknumbers": [
                1,
                2,
                3,
                4,
                5
              ]
            }
          }
        },
        "firstDayOfWeek": 2,
        "start": "2023-11-17T16:00:00.000Z",
        "startTime": 1700236800000,
        "end": "2023-11-17T16:00:00.000Z",
        "endTime": 1700236800000,
        "isDate": true,
        "isRange": false,
        "isComplex": false
      }
    }
  ]
}

数据结构中删除了dot相关,设置标注日期需要获取的待办数量customData: '9'

 attrs: [
        {
          key: 'v0Day',
          dates: new Date(),
          highlight: true,
          popover: {
            label: '美好的一天!要开心呦!'
          }
        },
        {
          key: 'V1Day',
          customData: '10', // 划重点!!!
          dates: new Date(2023, 10, 18),
          popover: {
            label: '美好的一天!要开心呦!'
          }
        },
        {
          key: 'V2Day',
          customData: '9', // 划重点!!!
          dates: new Date(2023, 10, 6)
        }
      ],

最后放一张效果图

码字果然类,最后放个官网链接☞Attributes | VCalendar

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1191324.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

php 二分查询算法实现

原理&#xff1a;二分查找算法&#xff08;Binary Search&#xff09;是一种针对有序数组的查找算法。它的原理是通过将查找区间逐渐缩小一半来快速定位要查找的目标值。 应用场景&#xff1a; 数据库或文件系统索引查找&#xff1a;在数据库或文件系统中&#xff0c;索引是有…

基于springboot 停车场管理系统-计算机毕设 附源码 39315

spring boot停车场管理系统的设计与实现 摘 要 科技进步的飞速发展引起人们日常生活的巨大变化&#xff0c;电子信息技术的飞速发展使得电子信息技术的各个领域的应用水平得到普及和应用。信息时代的到来已成为不可阻挡的时尚潮流&#xff0c;人类发展的历史正进入一个新时代。…

【C++数据结构】顺序存储结构的抽象实现

文章目录 前言一、目标二、SeqList实现要点三、SeqList函数实现3.1 get函数3.2 set函数3.3 insert函数带2个参数的insert带一个参数的insert 3.4 remove函数3.5 clear函数3.6 下标运算符重载函数无const版本const版本 3.7 length函数 总结 前言 当谈到C数据结构时&#xff0c;…

97 只出现一次的数字

只出现一次的数字 题解1 异或的应用&#xff08;判断出现次数是奇偶&#xff09; 给你一个 非空 整数数组 nums &#xff0c;除了某个元素只出现一次以外&#xff0c;其余每个元素均出现两次。找出那个只出现了一次的元素。 你必须设计并实现线性时间复杂度的算法来解决此问题…

PCIe寄存器之二

关键字索引&#xff1a; CAP_PM 对应&#xff1a;Capabilities: [c0] Power Management CAP_MSI 对应&#xff1a;Capabilities: [c8] MSI CAP_MSIX对应&#xff1a;Capabilities: [e0] MSI-X CAP_EXP 对应&#xff1a;Capabilities: [70] Express (v2) Endpoint 以上 [] 内的…

开设自己的网站系类03安装数据库(centos版)

编者买了一个服务器打算自己构建一个网站&#xff0c;用于记录生活。网站大概算是一个个人博客吧。记录创建过程的一些步骤。 前面已经讲过配置服务器的程序运行环境 网站运行还需要数据库&#xff0c;本篇文章则是安装数据库的内容。 卸载mariadb 查看是否有安装 mariadb&…

【Python】数据分析案例:世界杯数据可视化

文章目录 前期数据准备导入数据 分析&#xff1a;世界杯中各队赢得的比赛数分析&#xff1a;先打或后打的比赛获胜次数分析&#xff1a;世界杯中的抛硬币决策分析&#xff1a;2022年T20世界杯的最高得分者分析&#xff1a;世界杯比赛最佳球员奖分析&#xff1a;最适合先击球或追…

【C语言基础】近期所学到的函数以及关键字(函数memset、scanf、关键字staric、 inline、volatile)

&#x1f4e2;&#xff1a;如果你也对机器人、人工智能感兴趣&#xff0c;看来我们志同道合✨ &#x1f4e2;&#xff1a;不妨浏览一下我的博客主页【https://blog.csdn.net/weixin_51244852】 &#x1f4e2;&#xff1a;文章若有幸对你有帮助&#xff0c;可点赞 &#x1f44d;…

python核心编程速记【笔记迁移】

笔记速记 1.python非常注重缩进&#xff0c;这是它的显著特征之一。 2.import相当于头文件声明模块。 3.利用type函数 type(a)可以查看当前变量类型。 isinstance可以比较两个数据类型并返回一个布尔值。 4.这里面的可直接使用and和or作为一个函数 5.python的算法比较贴合…

如何改善食品饮料包装生产企业的OEE?

食品饮料这类商品在我们的日常生活中十分常见&#xff0c;它们存在于各类商店、超市或路边的小店里。而食品饮料的包装是吸引人们购买该产品的一个重要因素。为了在这个市场中脱颖而出并提高盈利能力&#xff0c;企业需要关注设备的综合效率&#xff0c;即OEE&#xff08;Overa…

SpringBoot测试类启动web环境-上篇

1.坐标修改 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency> 2.测试类测试 说明&#xff1a;SpringBootTest()中的webEnvironment值的说明&#xff1b; 2.1不启…

vue项目js原生属性IntersectionObserver实现图片懒加载

vue项目js原生属性IntersectionObserver实现图片懒加载 IntersectionObserver 使用js原生属性IntersectionObserver实现观察img元素是否处于游览器视口中 懒加载原理&#xff1a;给img设置一个默认url图片&#xff0c;观察图片处于视口内以后&#xff0c;动态改变img的url为自己…

机组 CPU

控制器&#xff1a;协调并控制计算机各部件执行程序的指令序列&#xff0c;其基本功能是取指令、分析指令和执行指令 功能 CPU 必须具有控制程序的顺序执行&#xff08;指令控制&#xff09;、产生完成每条指令所需的控制命令&#xff08;操作控制&#xff09;、对各种操作加…

原神游戏干货分享:探索璃月的宝箱秘密,提高游戏资源获取效率!

《原神》是一款备受玩家喜爱的开放世界冒险游戏&#xff0c;而在游戏中获取资源是提升角色实力的重要途径。在这篇实用干货分享中&#xff0c;我们将介绍一些探索璃月地区的宝箱秘密&#xff0c;帮助你提高游戏资源获取的效率。 首先&#xff0c;璃月地区的宝箱分为普通宝箱和精…

Leetcode刷题详解—— 找出所有子集的异或总和再求和

1. 题目链接&#xff1a;1863. 找出所有子集的异或总和再求和 2. 题目描述&#xff1a; 一个数组的 异或总和 定义为数组中所有元素按位 XOR 的结果&#xff1b;如果数组为 空 &#xff0c;则异或总和为 0 。 例如&#xff0c;数组 [2,5,6] 的 异或总和 为 2 XOR 5 XOR 6 1 。…

基于QT使用OpenGL,加载obj模型,进行鼠标交互

目录 功能分析&#xff08;需求分析&#xff09;技术点分析OpenGL立即渲染模式可编程渲染管线模式 QOpenGLWidget派生类 glwidget逻辑glwidget.hglwidget.cpp 鼠标交互功能obj格式介绍 效果bunnyCayman_GT 功能分析&#xff08;需求分析&#xff09; 基于QT平台&#xff0c;使…

【被面试官吊打系列】啥,你没说面试要考智力题呀 (上) ?

你好&#xff0c;我是安然无虞。 文章目录 1. 二进制问题分金条问题毒药问题 2. 先手必胜问题轮流拿石子抢30的必胜策略Nim游戏 3. 水桶问题5L和6L的水桶怎么量出3L的水&#xff1f;3L和5L的水桶怎么量出4L的水&#xff1f;一个装了10L水的桶&#xff0c;一个7L的空桶还有一个…

2.【自动驾驶与机器人中的SLAM技术】左乘模型推导ESKF

目录 1. 证明题 证明&#xff1a;若某个高斯随机变量为零均值&#xff0c;协方差为对角线矩阵且大小相同&#xff08;各向同性&#xff09;&#xff0c;那么在乘任意旋转矩阵以后&#xff0c;其均值仍为零&#xff0c;且协方差不变&#xff1b; 2. 代码实现运动方程将F矩阵…

FreeRTOS_内存管理

目录 1. 内存管理简介 2. 内存碎片 3. heap_1 内存分配方法 3.1 分配方法简介 4. heap_2 内存分配方法 4.1 分配方法简介 4.2 内存块详解 5. heap_4 内存分配方法 6. FreeRTOS 内存管理实验 6.1 实验程序 内存管理是一个系统基本组成部分&#xff0c;FreeRTOS 中大量…

计算机考研408有多难?25考研经验贴,开个好头很有必要

前言 大家好&#xff0c;我是陈橘又青&#xff0c;相信关注我的各位小伙伴们中&#xff0c;大多都是在计算机专业的大学生吧&#xff01; 每天都有许多人在后台私信我&#xff0c;问我要不要考研&#xff0c;我想说这个东西是因人而异的&#xff0c;像我本人就选择了就业&…