Table of Contents
CLI Project
Install vue-cli 3.x globally (skip this step if already installed)
Through CLI Create the uni-app project
Open the project in vscode
Import the code block that comes with HBuilderX
Publish project
HBuilderX 工程
初始化npm(如已初始化跳过此步骤)
安装 uni-app 语法提示
Home Development Tools VSCode Can vscode use uni-app?

Can vscode use uni-app?

Sep 29, 2021 pm 05:14 PM
uni-app vscode

vscode can use uni-app, the specific method: 1. Install the vue syntax prompt plug-in vetur; 2. Execute the "npm i @dcloudio/uni-helper-json" command to install the component syntax prompt; 3. Download and Just import the uni-app code that comes with HBuilderX.

Can vscode use uni-app?

The operating environment of this tutorial: Windows 7 system, Visual Studio Code version 1.45.1.0, DELL G3 computer.

uni-app is a framework that uses vue syntax to develop small programs, apps, and H5. The officially recommended development tool is HBuilderX, which provides a good development experience.

However, since HBuilderX does not have a Linux version and many front-ends have been accustomed to vscode before, they do not want to change editors. Directly using vscode to develop uni-app, the experience is not very good.

In fact, uni-app and vscode can also go well together. Next, I will show you the correct opening posture of uni-app in vscode.

CLI Project

Install vue-cli 3.x globally (skip this step if already installed)

npm install -g @vue/cli
Copy after login

Through CLI Create the uni-app project

vue create -p dcloudio/uni-preset-vue my-project
Copy after login

At this time, you will be prompted to select a project template. For first-time experience, it is recommended to select thehello uni-app project template, as shown below:

Can vscode use uni-app?

Open the project in vscode

Can vscode use uni-app?

Install the vue syntax prompt plug-in vetur

Can vscode use uni-app?

The CLI project comes with uni-app syntax prompts and 5 App syntax prompts by default

Can vscode use uni-app?

Can vscode use uni-app?

##Installation Component syntax prompts

Component syntax prompts are the highlight of uni-app, which few other frameworks can provide.

npm i @dcloudio/uni-helper-json
Copy after login

Can vscode use uni-app?

Can vscode use uni-app?

Import the code block that comes with HBuilderX

Download from github

uni-app code block, put it in the .vscode directory under the project directory to have the same code block as HBuilderX.

Can vscode use uni-app?

Can vscode use uni-app?

Can vscode use uni-app?##Run project

npm run dev:%PLATFORM%
Copy after login

Publish project

npm run build:%PLATFORM%
Copy after login

%PLATFORM%

Possible values ​​are as follows:

Valueh5mp-alipay mp-baidump-weixinmp- toutiaomp-qq

CLI 方式参考文档

HBuilderX 工程

HBuilderX 创建的工程默认不带 types 语法提示,在 vscode 中编辑的时候,可以自行安装

初始化npm(如已初始化跳过此步骤)

npm init -y
Copy after login

安装 uni-app 语法提示

npm i @types/uni-app @types/html5plus -D
Copy after login

另外,uni-app 项目下的 manifest.json、pages.json 等文件可以包含注释。vscode 里需要改用 jsonc 编辑器打开。

1Can vscode use uni-app?

关于uni-app插件市场的插件,vscode一样可以使用。

  • 如果这些插件有npm使用方式(如uni-ui),可以用npm
  • 如果作者没提供npm方式,那么下载zip包解压也是可以用的

1Can vscode use uni-app?

1Can vscode use uni-app?

1Can vscode use uni-app?

1Can vscode use uni-app?

1Can vscode use uni-app?

【相关推荐:《uniapp教程》、《vscode教程》】

The above is the detailed content of Can vscode use uni-app?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to define header files for vscode How to define header files for vscode Apr 15, 2025 pm 09:09 PM

How to define header files using Visual Studio Code? Create a header file and declare symbols in the header file using the .h or .hpp suffix name (such as classes, functions, variables) Compile the program using the #include directive to include the header file in the source file. The header file will be included and the declared symbols are available.

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to solve the problem of vscode Chinese annotations becoming question marks How to solve the problem of vscode Chinese annotations becoming question marks Apr 15, 2025 pm 11:36 PM

How to solve the problem that Chinese comments in Visual Studio Code become question marks: Check the file encoding and make sure it is "UTF-8 without BOM". Change the font to a font that supports Chinese characters, such as "Song Style" or "Microsoft Yahei". Reinstall the font. Enable Unicode support. Upgrade VSCode, restart the computer, and recreate the source file.

How to switch Chinese mode with vscode How to switch Chinese mode with vscode Apr 15, 2025 pm 11:39 PM

VS Code To switch Chinese mode: Open the settings interface (Windows/Linux: Ctrl, macOS: Cmd,) Search for "Editor: Language" settings Select "Chinese" in the drop-down menu Save settings and restart VS Code

How to set vscode in Chinese How to set vscode in Chinese Apr 15, 2025 pm 09:27 PM

There are two ways to set up a Chinese language in Visual Studio Code: 1. Install the Chinese language package; 2. Modify the "locale" settings in the configuration file. Make sure Visual Studio Code version is 1.17 or higher.

Common commands for vscode terminal Common commands for vscode terminal Apr 15, 2025 pm 10:06 PM

Common commands for VS Code terminals include: Clear the terminal screen (clear), list the current directory file (ls), change the current working directory (cd), print the current working directory path (pwd), create a new directory (mkdir), delete empty directory (rmdir), create a new file (touch) delete a file or directory (rm), copy a file or directory (cp), move or rename a file or directory (mv) display file content (cat) view file content and scroll (less) view file content only scroll down (more) display the first few lines of the file (head)

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

See all articles
Platform
H5
Alipay Mini Program
Baidu Mini Program
WeChat Mini Program
Toutiao Mini Program
qq Mini Program