當我嘗試匯入帶有后綴 (?component) 的 SVG 時,我的 vite 專案中出現打字稿錯誤。如何配置 typescript 以忽略這些后綴?
TS2307: Cannot find module './desktop-mark.svg?component' or its corresponding type declarations.
import DesktopLogoMark from './desktop-mark.svg?component';
uj5u.com熱心網友回復:
您需要添加模塊宣告:https : //www.typescriptlang.org/docs/handbook/modules.html#wildcard-module-declarations
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/409698.html
標籤:
