其他分享
首页 > 其他分享> > vue3.0+ts出现不提示@/components/xxx.vue的现象

vue3.0+ts出现不提示@/components/xxx.vue的现象

作者:互联网

1. 在src路径下创建shims-vue.d.ts

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

2. tsconfig的 include 中添加

  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx",
    "shims-vue.d"
  ],

  

标签:src,vue,xxx,ts,tsx,include,shims
来源: https://www.cnblogs.com/hwy6/p/15649174.html