📦 一个快速搭建「微信小程序」的模版!
-
点击本项目右上角的绿色按钮
Use this template
(使用此模板),输入名称和说明,完成创建。 -
将刚刚创建好的项目克隆到本地,这里以本项目为例,实际操作时这里需要替换你自己的项目。
git clone https://github.com/Ailln/miniprogram-template.git --depth 1
-
安装环境依赖,启动后端。(本项目需要 Python 环境,如果对这部分不熟悉的看最后的参考文章)
# 后端环境依赖安装 cd back pip install -r requirements.txt # 启动后端 python app.py
-
使用「微信开发者工具」将
miniprogram
的目录导入进去即可预览。 -
根据你的需求修改代码。
.
├── LICENSE
├── README.md
├── back
│ ├── app.py
│ └── requirements.txt
└── miniprogram
├── app.js
├── app.json
├── app.wxss
├── pages
│ ├── index
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ └── logs
│ ├── logs.js
│ ├── logs.json
│ ├── logs.wxml
│ └── logs.wxss
├── project.config.json
├── sitemap.json
└── utils
└── util.js
-
下载 weui-wxss 的代码, 将
dist
目录拷贝到miniprogram-template/miniprogram/
下面。 -
在
app.wxss
中全局引入,在第一行添加:@import "./dist/style/weui.wxss";
-
在wxml 中使用样式:
<button class="weui-btn" type="primary">页面主操作</button>
-
下载 iView Weapp 的代码, 将
dist
目录拷贝到miniprogram-template/miniprogram/
下面。 -
在页面的 json 中配置需要使用的组件:
"usingComponents": { "i-button": "../../dist/button/index" }
-
在 wxml 中使用组件:
<i-button type="primary">这是一个按钮</i-button>
-
下载 Vant Weapp 的代码, 将
dist
目录拷贝到miniprogram-template/miniprogram/
下面。 -
在页面的 json 中配置需要使用的组件:
"usingComponents": { "van-button": "../../dist/button/index" }
-
在 wxml 中使用组件:
<van-button type="primary">这是一个按钮</van-button>