Develop a mini program based on WePY. 基于 WePY,以 Web 前端的开发风格开发微信小程序。
基于 WePY,以 Web 前端的开发风格开发微信小程序。
# 安装 wepy-cli
$ npm install wepy-cli -g
# 下载代码
$ git clone https://github.com/zhaotoday/wepy.git
# 安装依赖包
$ npm install
# 实时编译
$ wepy build --watch
├── dist 编译目录
├── src 源码目录
| ├── components 通用组件目录
| | └── my-component my-component 组件
| | ├── index.wpy my-component 业务
| | ├── images my-component 图片
| | └── styles.scss my-component 样式
| |
| ├── mock 接口 mock
| ├── pages 页面目录
| | └── my-page my-page 页面
| | ├── index.wpy my-page 业务
| | ├── images my-page 图片
| | └── styles.scss my-page 样式
| |
| ├── assets 引用的第三方资源(如:WeUI)
| ├── styles 样式
| | ├── components 组件样式
| | ├── global 全局样式
| | └── utils Sass 工具
| | ├── functions Sass 函数
| | ├── mixins Sass mixin
| | └── variables Sass 变量
| |
| ├── static 静态资源,主要存放在 WXSS 里以 background-image 引用的一些图片
| ├── store redux 状态管理
| ├── utils JS 工具集合
| └── app.wpy 小程序配置项(全局样式配置、声明钩子等)
└── package.json package 配置