First, editor preparation

Download and install wechat developer tools and VScode (recommended)

Two, install Taro CLI

The node.js installation address is nodejs.org/en/

npm i -g @tarojs/cli
Copy the code

or

yarn global add @tarojs/cli
Copy the code

After the installation is complete, run the taro -v command to check whether the installation is successful

Initialize the project

Taro init your project name

taro init myApp
Copy the code

The command output is as follows: Perform the configurations as prompted

  • Project introduction: Your introduction about the project

  • Select your framework (up or down, Enter to confirm)

  • Whether to use TS

  • Select the CSS preprocessor

  • Select the template source and template

Project created successfully

This is the project path after successful initialization

Functions of each document:

Iv. Start the project

npm run dev:weapp
Copy the code

or

yarn dev:weapp
Copy the code

After you start the project, you will have a dist folder, which is the package directory for the applet.

The SRC folder is the development directory. During the development of small programs, the code is written in the SRC folder. After the project is started and the saving operation, it will be automatically synchronized to Dist.

5. Open the mini program in the wechat developer tool

Directory select the dist folder

AppID uses the ID or test number of the applet you signed up for

Small program registered address mp.weixin.qq.com/wxopen/ware…

Open successfully – vscode compiled code will be automatically synchronized after saving.