国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

ts依賴引入報(bào)錯(cuò):無(wú)法找到模塊“xxxxxx”的聲明文件問(wèn)題解決

瀏覽:2日期:2022-06-13 14:39:17

依賴引入報(bào)錯(cuò)是因?yàn)閠s沒(méi)有識(shí)別當(dāng)前引入的依賴,在vite-env.d.ts中聲明該依賴即可解決,語(yǔ)法:declare module "依賴名";

declare module 'file-saver';

解決找不到模塊“./App.vue”或其相應(yīng)的類型聲明。

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

解決router引入報(bào)錯(cuò)的問(wèn)題

declare module '*./router' { import type { DefineComponent } from 'vue-router' const component: DefineComponent<{}, {}, any> export default component}

declare module 'vue-router'

一些依賴報(bào)錯(cuò)問(wèn)題的解決

// <reference types='vite/client' />// 解決引入vue的報(bào)錯(cuò)declare module '*.vue' { import { DefineComponent } from 'vue'; const component: DefineComponent<{}, {}, any>; export default component;}// 解決引入scss報(bào)錯(cuò)問(wèn)題declare module '*.scss' { const scss: Record<string, string>; export default scss;}// 解決引入模塊的報(bào)錯(cuò)提示declare module 'vuedraggable/src/vuedraggable';declare module '@pureadmin/components';declare module '@pureadmin/theme';declare module '@pureadmin/theme/dist/browser-utils';declare module 'nprogress';declare module 'file-saver';declare module 'element-plus/dist/locale/zh-cn.mjs'; /*解決element-plus國(guó)際化依賴報(bào)錯(cuò)*//* 解決axios報(bào)錯(cuò):類型“{ params: any; '': any; }”的參數(shù)不能賦給類型“AxiosRequestConfig<any> 解決:屬性“xxxxx”在類型”{ $: ComponentInternalInstance; $data : {}; $props:Part......報(bào)錯(cuò)問(wèn)題 */declare module 'axios' { export interface AxiosRequestConfig { // 添加數(shù)據(jù)類型 handlerEnabled?: boolean; baseURL: string; timeout: number; }}// 處理TS數(shù)據(jù)類型問(wèn)題 類型“AxiosResponse<any, any>”上不存在屬性“meta”。declare module 'axios' { interface AxiosResponse<T = any> { meta: any; // 這里追加你的參數(shù) baseURL?: string; timeout?: number; } export function create(config?: AxiosRequestConfig): AxiosInstance;}

總結(jié)

到此這篇關(guān)于ts依賴引入報(bào)錯(cuò):無(wú)法找到模塊“xxxxxx”的聲明文件問(wèn)題解決的文章就介紹到這了,更多相關(guān)ts無(wú)法找到模塊xxxxxx的聲明文件內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: JavaScript
主站蜘蛛池模板: 东莞市| 开化县| 临洮县| 沿河| 苏尼特右旗| 咸丰县| 迭部县| 新兴县| 玉山县| 正阳县| 监利县| 霍城县| 华阴市| 丹东市| 都安| 平武县| 河南省| 北海市| 五峰| 祥云县| 伊金霍洛旗| 林州市| 茂名市| 乃东县| 凌源市| 绥中县| 平塘县| 达州市| 林周县| 通州区| 军事| 潞西市| 潞城市| 平塘县| 海城市| 达拉特旗| 南召县| 屏南县| 通榆县| 定日县| 彩票|