Error in mounted hook: TypeError: Cannot read properties of undefined (reading isHiddenDay ) found
無法讀取未定義的屬性‘isHiddenDay’. 在vue中使用fullcalendar在mounted鉤子中渲染報錯
背景
我在一個小demo中實現(xiàn)還是好好的,并且用的依賴都是6.x版本的,但是當(dāng)我合并到正式項目中時確一直無法渲染出來。并且我正式項目中的版本依賴和demo中的依賴是一一致的,但是始終無法解決問題。最終我去了FullCalendar的github官網(wǎng)中找,試了很多辦法,最終不得已只能采用降低版本來解決問題。我看github中討論產(chǎn)生這種情況的有很多,大多數(shù)是認(rèn)為這是npm包管理工具的一些問題,然后還有一些是fullcalendar本身版本的問題。
我的小demo中的依賴版本:
最終在正式項目中的依賴版本:
解決辦法
直接把所有與FullCalendar相關(guān)的插件版本號6.0.2改為5.4.0。然后執(zhí)行npm install即可
。如果這仍然無法解決你的問題,那么你可以直接到它的官網(wǎng)的issue中搜索關(guān)鍵字isHiddenDay即可,這里我給出兩個對我有幫助的鏈接:isHiddenDay討論比較多的issue和比較新的一個issue。希望我能夠幫助大家節(jié)省一點時間
我采用的是github中的這個解決方案:文章來源:http://www.zghlxwxcb.cn/news/detail-443762.html
Uninstall all @fullcalendar packages
Install packages again
make sure
all packages version 5.4.0 .
“@fullcalendar/daygrid”: “^5.4.0”,
“@fullcalendar/interaction”: “^5.4.0”,
“@fullcalendar/react”: “^5.4.0”,
“@fullcalendar/timegrid”: “^5.4.0”文章來源地址http://www.zghlxwxcb.cn/news/detail-443762.html
到了這里,關(guān)于Error in mounted hook: TypeError: Cannot read properties of undefined (reading isHiddenDay ) found的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!