2
當我嘗試加載日曆時,webpack編譯器似乎無法識別jQuery正在使用?我正在關注basic usage指南
我假設因爲完整的日曆已經綁定了jquery,我已經不需要調用它了。
在我app.js
我通過
import fullCalendar from 'fullCalendar';
const calendar = document.getElementById('calendar');
$(calendar).fullCalendar();
調用fullCalendar我知道我做錯了什麼,我無法找到完整的日曆文檔中的任何導入方法。
這可能是因爲你是在純javascript和jquery之間切換。你應該使用一個或另一個。嘗試使用$('#calendar')創建日曆 – Justin
Justin是正確的,'getElementById'返回一個HTML DOM元素,而jQuery的'$(...)'返回一個jQuery對象 –
@Justin感謝您的回覆。我切換到你的方法,我仍然導致相同的錯誤。 – Simon