本文主要是介绍使用unplugin-auto-import页面不引入api飘红,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
解决方案:.
tsconfig.json文件夹加上
{"compilerOptions": {"target": "ES2020","useDefineForClassFields": true,"module": "ESNext","lib": ["ES2020", "DOM", "DOM.Iterable"],"skipLibCheck": true,/* Bundler mode */"moduleResolution": "bundler","allowImportingTsExtensions": true,"resolveJsonModule": true,"isolatedModules": true,"noEmit": true,"jsx": "preserve",/* Linting */"strict": true,"noUnusedLocals": true,"noUnusedParameters": true,"noFallthroughCasesInSwitch": true},"include": ["src/**/*.js","src/**/*.ts","src/**/*.tsx","src/**/*.vue","./auto-imports.d.ts"],"references": [{ "path": "./tsconfig.node.json" }]
}
"./auto-imports.d.ts"即可
vite-env.d.ts文件夹粘贴
/// <reference types="vite/client" />
declare module '*.vue' {import { ComponentOptions } from 'vue'const componentOptions: ComponentOptionsexport default componentOptions
}
这篇关于使用unplugin-auto-import页面不引入api飘红的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!