200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > Vue +TS 找不到模块 或 其相应的类型声明

Vue +TS 找不到模块 或 其相应的类型声明

时间:2021-05-19 02:58:46

相关推荐

Vue +TS 找不到模块 或 其相应的类型声明

找不到模块“../views/**.vue”或其相应的类型声明。

In the src folder add the file shims-vue.d.ts with the following content:

在src文件夹下新建shims-vue.d.ts,然后输入以下内容

Vue 2:

declare module "*.vue" {import Vue from 'vue'export default Vue}

Vue 3:

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

问题解决

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。