Error reporting after creating vue3 project

Module ""vue"" has no exported member "createApp".

Error: Module ""vue"" has no exported member "createApp".
Solution: Execute the command linenpm i [email protected]

insert image description here

Cannot find module './App.vue' or its corresponding type declaration.

Error: Cannot find module "./App.vue" or its corresponding type declaration.

insert image description here
Solution: Create a .d.ts file in the src root directory and add the following code

declare module '*.vue' {
    
    
  import type {
    
     DefineComponent } from 'vue'
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
  const component: DefineComponent<{
    
    }, {
    
    }, any>
  export default component
}

insert image description here

Guess you like

Origin blog.csdn.net/qq_51741730/article/details/128463843