npm init @vitejs/app vue3-demo
cd vue3-demo
npm install
npm run dev
image.png
入口文件:
index.html
中导入了src
目录下的main.ts
模块;main.ts
:从vue
中导入createApp
方法和App
组件挂载到#app
元素上。
引入组件has no default export.
tsconfig.ts
添加
{
compilerOptions:{
allowSyntheticDefaultImports: "true"
}
}
还是会提示错误
解决方法:
1、打开文件-首选项-设置
2、搜索validate
,去掉javascript
的验证,重启vscode
如下
网友评论