Uncaught TypeError: Cannot read property 'length' of undefined
突出显示这部分 fullcalendar/main.js 代码中的错误
function addDefs(defs) {
for (var _i = 0, defs_1 = defs; _i < defs_1.length; _i++)
这是我的代码:
yarn add @fullcalendar/core
yarn add @fullcalendar/daygrid
应用程序.js
import moment from 'moment'
window.moment = moment
import { Calendar } from '@fullcalendar/core/';
import dayGridPlugin from '@fullcalendar/daygrid';
global.FullCalendar = require("@fullcalendar/core/");
应用程序.scss
@import '@fullcalendar/common/main.css';
@import '@fullcalendar/daygrid/main.css';
看法
<div id="calendar"></div>
<script>
document.addEventListener('DOMContentLoaded', function () {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
....
}
});
// render the calendar
calendar.render();
});
</script>