taro+vue3 builds a framework suitable for WeChat mini programs and H5

Here I write taro+vue3 to build a framework suitable for WeChat mini programs and H5

The general steps for Taro+Vue3 to build a framework suitable for WeChat mini programs and H5:

Install Taro. You can enter the following command in the terminal to install:

 npx @tarojs/cli init myApp

Create project. Create a Taro+Vue3 project using the following command:

taro init myApp --template vue3

Where, myApp is the project name.

Enter the project and start it. Enter the project and start it using the following command:

cd myApp
npm run dev:weapp // 微信小程序
npm run dev:h5 // H5

Note that you need to enter the corresponding directory before starting.

Write code. By writing code in the src directory, you can develop applets and H5 just like you use Vue to develop web applications.

Taro+Vue3 provides many components and APIs, and detailed usage can be found in the documentation. It should be noted that when using Taro to develop a mini program, you need to use the components and APIs provided by Taro, and you cannot directly use the native components and APIs of the mini program.

Packaged and released. Use the following commands to package and publish:

npm run build:weapp // 微信小程序
npm run build:h5 // H5

The packaged files will be generated in the dist directory.

Guess you like

Origin blog.csdn.net/u010689434/article/details/129082253