uniapp project practice chapter 2: use vscode to develop uniapp projects

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
insert image description here
and install the plugin
insert image description here

Then you can create a new uniapp page
insert image description here

Create a new page and organize the code
insert image description here
insert image description here
to view the route
insert image description here

Install the plug-
insert image description here
insert image description here
in and hover the mouse, there will be a prompt,
insert image description here
you can run to the corresponding official document with one click
insert image description here

Run the following command
npm install --save-dev @types/wechat-miniprogram @uni-helper/uni-app-types
insert image description here
to rewrite the tsconfig.json file. After configuring the following, you can check the syntax of ts
insert image description here
insert image description here

{
    
    
  "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"]
}

insert image description here

At this time, ctrl+i can prompt the code
insert image description here

Handling of code comment alarms
insert image description here
insert image description here

insert image description here

// 配置语言的文件关联
  "files.associations": {
    
    
    "pages.json": "jsonc",
    "manifest.json": "jsonc",
  }

Guess you like

Origin blog.csdn.net/qq_51447496/article/details/132322804