Use vscode to develop uniapp project
Introduction: This article explains how to use vscode to develop uniapp projects.
First use vscode to open the project
and install the plugin
Then you can create a new uniapp page
Create a new page and organize the code
to view the route
Install the plug-
in and hover the mouse, there will be a prompt,
you can run to the corresponding official document with one click
Run the following command
npm install --save-dev @types/wechat-miniprogram @uni-helper/uni-app-types
to rewrite the tsconfig.json file. After configuring the following, you can check the syntax of ts
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"lib": ["esnext", "dom"],
"types": [
"@dcloudio/types",
"@types/wechat-miniprogram",
"@uni-helper/uni-app-types"]
},
// vue 编译器类型,校验标签类型
"vueCompilerOptions": {
"nativeTags": ["block", "component", "template", "slot"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
At this time, ctrl+i can prompt the code
Handling of code comment alarms
// 配置语言的文件关联
"files.associations": {
"pages.json": "jsonc",
"manifest.json": "jsonc",
}