【问题标题】:TypeError: "context is undefined" is undefined, what could be the cause?TypeError:“上下文未定义”未定义,可能是什么原因?
【发布时间】:2020-06-25 06:52:19
【问题描述】:

我在整合 fullCalendar 时间线时遇到问题。

TypeError:“上下文未定义”

_renderSkeleton http://localhost:8080/scripts/fullcalendar/v4/resource-timeline/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:596
res http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:3189
render http://localhost:8080/scripts/fullcalendar/v4/resource-timeline/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:574
receiveProps http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:3887
renderView http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:6277
render http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:6202
receiveProps http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:3887
renderComponent http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:6817
executeRender http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:6774
render http://localhost:8080/scripts/fullcalendar/v4/core/main.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:6596
calendar http://localhost:8080/resource?row_id=267&_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:1
loadCalendar http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:1176
render http://localhost:8080/resource?row_id=267&_=1f5faae92d540252c76d4f50aa1163c73ac8937a_20200625092942:2
<anonymous> http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a line 641 > eval:1
<anonymous> http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a line 641 > eval:1
exec http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:641
external http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:635
display http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:2544
external http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:635
disp http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:634
ok http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:1096
canCloseContent http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:1097
disp http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:634
external http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:635
load http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:538
onload http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:537
onload http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:536
loadScript http://localhost:8080/scripts/ui/ui-bundle.js?_=1f5faae92d540252c76d4f50aa1163c73ac8937a:522

所有插件 JS/CSS 似乎都已完美加载:core、daygrid、interaction、list、resource-common、resource-timeline、timeline、timegrid。

这是我的 javascript 代码。

var AppTestTimeline = AppTestTimeline || (function ($) {
    
    function calendar() {
        new FullCalendar.Calendar($("#testtimeline")[0], {
            plugins: [ 'interaction', 'resourceTimeline' ],
            defaultView: 'resourceTimelineDay',
            aspectRatio: 1.5,
            header: { left: 'prev,next', center: 'title', right: 'resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth' },
            editable: false,
            resourceLabelText: 'Rooms',
            resources: 'https://fullcalendar.io/demo-resources.json?with-nesting&with-colors',
            events: 'https://fullcalendar.io/demo-events.json?single-day&for-resource-timeline'
        }).render();
    }

    return { render: function(params) {
        $ui.loadCalendar(calendar);
    }};

})(jQuery);

可能是什么原因,应该去哪里寻找线索?

谢谢。

【问题讨论】:

    标签: javascript fullcalendar-4 fullcalendar-scheduler


    【解决方案1】:

    好的,问题是核心库版​​本与我拥有的时间线库不兼容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-26
      • 1970-01-01
      • 2013-01-10
      • 1970-01-01
      • 1970-01-01
      • 2019-04-06
      • 2014-05-15
      • 1970-01-01
      相关资源
      最近更新 更多