最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Vue3解決找不到模塊@/components/xxx.vue或其相應(yīng)的類型聲明ts文件(2307)問題

 更新時(shí)間:2025年06月17日 10:38:47   作者:小徐敲java  
這篇文章主要介紹了Vue3解決找不到模塊@/components/xxx.vue或其相應(yīng)的類型聲明ts文件(2307)問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

問題

1:如果沒有這個(gè)env.d.ts文件

就新建

declare module "*.vue" {
  import { DefineComponent } from "vue";
  const component: DefineComponent<{}, {}, any>;
  export default component;
}

2:如果有tsconfig.json文件

但是還是一樣報(bào)錯(cuò),就需要include讀取文件env.d.ts文件

3:如果需要使用@簡寫訪問src

如下3-1:如果沒有這個(gè)tsconfig.json文件,就新建

{
  "compilerOptions": {
    "target": "esnext",
    "useDefineForClassFields": true,
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["esnext", "dom"],
    "baseUrl": "./",
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "allowSyntheticDefaultImports": true,
    "strictFunctionTypes": false,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "skipLibCheck": true,
    "paths": {
      "@/*": ["src/*"]
    },
    "types": [
      // "@intlify/unplugin-vue-i18n/types",
      "vite/client"
      // "element-plus/global",
      // "@types/qrcode",
      // "vite-plugin-svg-icons/client"
    ],
    "outDir": "target", // 請保留這個(gè)屬性,防止tsconfig.json文件報(bào)錯(cuò)
    "typeRoots": ["./node_modules/@types/", "./types"]
  },
  "include": [
    "src",
    "types/**/*.d.ts",
    "src/types/auto-imports.d.ts",
    "src/types/auto-components.d.ts"
  ],
  "exclude": ["dist", "target", "node_modules"]
}

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

东港市| 龙里县| 宜春市| 祁阳县| 张家界市| 文登市| 应城市| 中牟县| 寻乌县| 道真| 静宁县| 毕节市| 黔西县| 鸡东县| 兴宁市| 通辽市| 襄樊市| 漳平市| 房山区| 五指山市| 永吉县| 礼泉县| 咸宁市| 泽普县| 舒兰市| 武宁县| 嵩明县| 达拉特旗| 垫江县| 榆中县| 朝阳县| 五大连池市| 永川市| 车致| 临清市| 荃湾区| 乐东| 通化县| 教育| 北票市| 民丰县|