Vuetify3 錯誤出現原因: Failed to resolve component: v-calendar

筆者每天的寫作時間都是在晚上 10 點到凌晨 2 點左右,先寫完文章再寫 Side Project。前幾天頭昏昏,使用 Vuetify3 的日曆元件 v-calendar 時一直無法使用,出現下面錯誤:
    
[Vue warn]: Failed to resolve component: v-calendar
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Component <Anonymous> is missing template or render function.
    

奇怪了,第一次在 Nuxt3 使用 Vuetify3 ,是 Vuetify3 沒有裝好嗎? 試了老半天都不能,但是其他元件可以使用,而且文件中日曆元件明明就是叫做 v-calendar 阿...

洗個澡頭腦清醒了一下後開個新的 html 檔案想說使用 CDN 試試看,結果剛引用到一半發現怎麼是 Vuetify2 ?!
回想到當初在文件上面沒有搜尋到 calendar ,是使用 google 搜尋 Vuetify3 + calendar 找出來的文件,然後錯誤訊息也顯示沒有 v-calendar 這個元件,難道說 Vuetify3 還沒出日歷元件?

認真上網 Google 了一下,在 reddit 中發現原來原本預計在 2023 年第一季就出現的 v-calendar 跳票到第二季了,也就是現在沒有日曆元件可以使用...

結論就是無限捲動(v-infinite-scroll)、日曆元件(v-calendar)、日期選擇元件(v-date-picker)在 Vuetify3 中都還沒有,只能繼續使用 Vue2 + Vuetify2 ,不然就是需要尋求替代方案了。

那我的 Side Project 再等一下好了...

參考資料:
Vuetify Labs

留言