Taro is a multi-end development solution that follows React syntax specifications. Nowadays, there are various forms of high-end on the market. Various terminals such as Web, React-Native, and WeChat applets are very popular. When business requirements require performance on different terminals at the same time, multiple sets of codes must be written for different terminals. The cost is obviously very high. At this time, the ability to adapt to multiple terminals by writing only one set of code is extremely necessary.
Using Taro , we can only write one set of code, and then use Taro 's compilation tool to compile the source code into programs that can be run on different terminals (WeChat/Baidu/Alipay/ByteDance mini programs, H5, React-Native, etc.) code.
This project is based on Taro and builds a fashion wardrobe project demonstration, which involves the complete business logic and functional points of an e-commerce platform. If this project can be mastered, I believe that other React projects of most companies will not be affected. Down.
If the network is poor, please move to the domestic mirror acceleration node
Please click here to view the demo (please use chrome mobile mode to preview)
React + Taro + Dva + Sass + ES6/ES7
git clone [email protected]:EasyTuan/taro-msparis.git
# 国内镜像加速节点:[email protected]:easytuan/taro-msparis.git
cd taro-msparis
# 全局安装taro脚手架
npm install -g @tarojs/[email protected]
# 项目依赖为1.2.2版本,如要升级,请同时升级项目依赖
# 如用1.2.2版本,请忽略这句
taro update project
# 安装项目依赖
npm install
# 微信小程序
npm run dev:weapp
# 支付宝小程序
npm run dev:alipay
# 百度小程序
npm run dev:swan
# 字节跳动小程序
npm run dev:tt
# H5
npm run dev:h5
# React Native
npm run dev:rn
# pages模版快速生成
npm run tep `文件名`
git branch description:
init: the overall structure of the framework, does not involve any business logic
master: the stable version of the project
feature: project development branch
Directory structure
├── .temp // H5编译结果目录
├── .rn_temp // RN编译结果目录
├── dist // 小程序编译结果目录
├── config // Taro配置目录
│ ├── dev.js // 开发时配置
│ ├── index.js // 默认配置
│ └── prod.js // 打包时配置
├── screenshots // 项目截图,和项目开发无关
├── site // H5静态文件(打包文件)
├── src // 源码目录
│ ├── components // 组件
│ ├── config // 项目开发配置
│ ├── images // 图片文件
│ ├── models // redux models
│ ├── pages // 页面文件目录
│ │ └── home
│ │ ├── index.js // 页面逻辑
│ │ ├── index.scss // 页面样式
│ │ ├── model.js // 页面models
│ │ └── service.js // 页面api
│ ├── styles // 样式文件
│ ├── utils // 常用工具类
│ ├── app.js // 入口文件
│ └── index.html
├── package.json
└── template.js // pages模版快速生成脚本,执行命令 npm run tep `文件名`
If it is helpful to you, you can click "Star" in the upper right corner to support it. Thank you! ^_^
Or you can "follow", I will continue to open source more interesting projects
If you have any questions, please raise them directly in Issues, or if you find a problem and have a very good solution, PR is welcome?
https://nervjs.github.io/taro/docs/README.html
https://dvajs.com/
https://mp.weixin.qq.com/debug/wxadoc/dev/
https://smartprogram.baidu.com/docs/introduction/register/index.html
https://docs.alipay.com/mini/developer/getting-started
https://microapp.bytedance.com/
If it helps, you are welcome to sponsor
After receiving the sponsorship money, I will update the sponsorship wall in time
MIT