最新国产好看的视频,伊人天堂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", // 請(qǐng)保留這個(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)論

清水河县| 阜平县| 漳浦县| 彩票| 衡山县| 徐汇区| 辉县市| 阿合奇县| 宁津县| 建始县| 南通市| 南漳县| 安远县| 营山县| 永胜县| 广安市| 锡林浩特市| 杭锦后旗| 扎兰屯市| 和顺县| 嘉定区| 正镶白旗| 探索| 五寨县| 云林县| 美姑县| 盐津县| 朝阳县| 维西| 万全县| 师宗县| 砚山县| 江西省| 太仓市| 乌恰县| 江孜县| 进贤县| 织金县| 茶陵县| 达尔| 凤庆县|