Overview
The Taro 2.x project template is a long-term maintained template based on Taro 2.x. It also provides versions 1.x and 3.x (based on React) for selection. The template includes features such as navigation, project structure, development, compilation, and deployment. It also supports TypeScript, Sass, UI library (taro-ui), state management (mobx), asynchronous programming (async/await), font importing (iconfont), and interface requests.
Features
- TypeScript: Supports TypeScript for development.
- Sass: Allows global injection of common style files.
- UI Library (taro-ui): Includes a UI library for use in the project.
- State Management (mobx): Includes state management using MobX.
- Asynchronous Programming (async/await): Supports asynchronous programming using async/await.
- Font Importing (iconfont): Allows importing of custom fonts using iconfont.
- Interface Requests: Includes a request class and interceptors for handling interface requests.
- Development Environment Proxy: Supports local proxy for development environment (h5 platform).
- Debugging: Includes vconsole for debugging purposes.
- Engineering Features: Includes global variables, plugins, and environment variable checks.
- Component Library (taro-xui): Includes a custom component library for use in the project.
- Utils Library (wtils): Includes a custom utility library for use in the project.
Installation
To install the Taro 2.x project template, follow these steps:
- Clone the repository from the GitHub page.
- Run
npm installoryarn installto install the necessary dependencies. - Customize the template as needed.
Summary
The Taro 2.x project template is a comprehensive template for developing projects using Taro 2.x. It includes features such as TypeScript support, Sass styling, a UI library (taro-ui), state management using MobX, and asynchronous programming using async/await. It also provides tools for interface requests, debugging, and engineering features such as global variables, plugins, and environment variable checks. Additionally, it includes a custom component library (taro-xui) and a utility library (wtils) for use in the project. Overall, it offers a robust framework for developing Taro 2.x projects.