【发布时间】:2018-05-18 11:33:59
【问题描述】:
我想知道从 npm 安装后如何导入 jQuery 库。 我做了以下,但我遇到了以下错误。
import countdown from 'jquery.countdown';
$.countdown = countdown;
$("#hours1").countdown("2020/05/01 16:00:00", function (event) {
$(this).text(event.strftime('%H'));
});
和
import countdown from 'jquery.countdown';
window.$.countdown = countdown;
$("#hours1").countdown("2020/05/01 16:00:00", function (event) {
$(this).text(event.strftime('%H'));
});
错误:
Uncaught TypeError: $(...).countdown is not a function
【问题讨论】:
标签: javascript jquery npm ecmascript-6