首页 > 解决方案 > 组件上的聚合物 3.x 全日历导入错误

问题描述

我在导入 Fullcalendar JS 库时遇到问题。我将它与 NPM 以及 momentjs 和 jquery 一起安装。

但是,我在浏览器中遇到此错误。

fullcalendar.js:211 Uncaught TypeError: Cannot read property 'fn' of undefined
at Object.<anonymous> (fullcalendar.js:211)
at __webpack_require__ (fullcalendar.js:11)
at Object.<anonymous> (fullcalendar.js:743)
at __webpack_require__ (fullcalendar.js:11)
at Object.<anonymous> (fullcalendar.js:347)
at __webpack_require__ (fullcalendar.js:11)
at Object.<anonymous> (fullcalendar.js:1944)
at __webpack_require__ (fullcalendar.js:11)
at fullcalendar.js:20
at fullcalendar.js:20

这是组件的导入。

import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
import '@polymer/iron-ajax/iron-ajax.js';
import './shared-styles.js';
import 'jquery';
import moment from 'moment';
import 'fullcalendar';

我该如何解决这个问题?

PS:大多数全日历包装器或组件不会迁移到聚合物 3.x 中

标签: fullcalendarpolymer-3.x

解决方案


推荐阅读