1:安裝
npm i fullcalendar -S
2:引入
import fullcalendar from "fullcalendar";
import "fullcalendar/dist/fullcalendar.min.css";
import "fullcalendar/dist/locale/zh-cn.js";(中文包)
3:使用
$("#calendar").fullCalendar({
header: { left: "prev,next today", center: "title", right: "month,basicWeek" },
navLinks: true, // can click day/week names to navigate views
editable: true,
eventLimit: true, // allow "more" link when too many events
eventLimitText: "更多",
events: [ { title: "All Day Event", start: "2018-11-01", color: "#06BB87" }, ] });
4:注意事項(xiàng)
4.1依賴(lài)moment.js/jquery.js坟岔。
4.2渲染前需要在html中設(shè)置一個(gè)容器嘴瓤,本文是#calendar先嬉。