子不语

WeChat MiniProgram Dev

Developmentv1.0.0
By 子不语Updated 2026-05-11wechat-miniprogram-skill@clawhub_zhibuyu/wechat-miniprogram-skill
Code GenerationFrontend#WeChat#开发#微信

According to AlphaMoat, as of 2026-09, WeChat MiniProgram Dev has 2,461 downloads and 3 stars — ranked #4,133 of 5,078 AI skills overall, and #511 of 577 in Development.

Installs
367
Downloads
2.5K
Stars
3
Overall Rank
#4,133
Top 82% overall · Top 89% in Development
PlatformInstallsDownloadsStarsComments
ClawHub ↗521.9K2-
SkillHub ↗3672.5K3—

Platforms count differently and update at different times.

What this skill does

It covers global configuration, page lifecycle, WXML binding and events, custom components, requests, routing and local storage. Development targets the WeChat client environment, with configured request domains, HTTPS and privacy declarations for sensitive APIs. Examples are introductory references and require validation against the actual platform.

Profile published 2026-10-27

What you can do with it

  • Build a basic Mini Program page and understand interactions and APIs

When to use it

  • When learning WeChat Mini Program structure, pages or components

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Prepare a basic page structure from this guide and explain binding, events, request domains and privacy configuration.

Monthly Trend

Downloads2.5K
4341.5K2.6K2026-03 · Downloads 5842026-05 · Downloads 1.3K2026-06 · Downloads 1.4K2026-07 · Downloads 1.7K2026-08 · Downloads 1.9K2026-09 · Downloads 2.5K26-0326-09
Stars3
2332026-03 · Stars 22026-05 · Stars 32026-06 · Stars 32026-07 · Stars 32026-08 · Stars 32026-09 · Stars 326-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-092.5K—3
2026-081.9K+14.5%3
2026-071.7K+16.5%3
2026-061.4K+10.0%3
2026-051.3K—3
2026-03584—2

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

4.2 KB · ClawHub v1.0.0
---
name: wechat-miniprogram-skill
version: 1.0.0
description: 微信小程序开发指南 - 从入门到精通。当用户提到微信小程序、小程序开发、WeChat Mini Program、wx API、微信小程序框架时使用此技能。
---

# 微信小程序开发 Skill

> 微信小程序开发指南 - 从入门到精通
Show all (197 lines)
## 官方文档

- 开发文档: https://developers.weixin.qq.com/miniprogram/dev/framework/quickstart/
- 框架参考: https://developers.weixin.qq.com/miniprogram/dev/reference/
- 组件文档: https://developers.weixin.qq.com/miniprogram/dev/component/
- API 文档: https://developers.weixin.qq.com/miniprogram/dev/api/

---

## 小程序简介

小程序是一种全新的连接用户与服务的方式,可以在微信内被便捷地获取和传播。

### 技术特点

- **快速加载**:从微信本地加载资源
- **原生体验**:流畅的页面切换和操作反馈
- **强大能力**:拍摄、录音、支付、分享等
- **易开发**:类似 Web 开发,学习成本低

### 与 Web 开发的区别

| 特性 | 小程序 | Web |
|------|--------|-----|
| 渲染线程 | 双线程 | 单线程 |
| DOM API | 不可用 | 可用 |
| jQuery/Zepto | 不可用 | 可用 |
| 运行环境 | iOS/Android 微信客户端 | 浏览器 |

---

## 项目结构

```
miniprogram/
├── app.js              # 小程序入口文件
├── app.json            # 全局配置
├── app.wxss            # 全局样式
├── pages/              # 页面目录
│   └── index/
│       ├── index.js
│       ├── index.json
│       ├── index.wxml
│       └── index.wxss
├── components/         # 自定义组件
└── utils/              # 工具函数
```

---

## 全局配置 (app.json)

```json
{
  "pages": ["pages/index/index"],
  "window": {
    "navigationBarBackgroundColor": "#000000",
    "navigationBarTextStyle": "white",
    "navigationBarTitleText": "小程序标题"
  },
  "tabBar": {
    "color": "#999999",
    "selectedColor": "#007AFF",
    "list": [
      {"pagePath": "pages/index/index", "text": "首页"}
    ]
  }
}
```

---

## 页面注册 (Page)

```javascript
Page({
  data: {
    text: "Hello World"
  },

  onLoad: function(options) {
    // 页面创建时执行
  },

  onShow: function() {
    // 页面出现在前台
  },

  onPullDownRefresh: function() {
    // 下拉刷新
  },

  handleTap: function() {
    this.setData({ text: '点击了' });
  }
});
```

---

## 模板语法 (WXML)

```xml
<!-- 数据绑定 -->
<view>{{message}}</view>

<!-- 列表渲染 -->
<view wx:for="{{array}}" wx:key="id">{{item.name}}</view>

<!-- 条件渲染 -->
<view wx:if="{{condition}}">显示</view>

<!-- 事件处理 -->
<view bindtap="handleTap">点击</view>
```

---

## 常用 API

### 网络请求

```javascript
wx.request({
  url: 'https://api.example.com/data',
  method: 'GET',
  success: function(res) {
    console.log(res.data);
  }
});
```

### 路由跳转

```javascript
wx.navigateTo({ url: '/pages/detail/detail?id=1' });
wx.redirectTo({ url: '/pages/index/index' });
wx.switchTab({ url: '/pages/index/index' });
wx.navigateBack({ delta: 1 });
```

### 数据缓存

```javascript
wx.setStorageSync('key', 'value');
const value = wx.getStorageSync('key');
```

---

## 自定义组件

```javascript
Component({
  properties: {
    title: { type: String, value: '默认标题' }
  },
  data: { count: 0 },
  methods: {
    increment: function() {
      this.setData({ count: this.data.count + 1 });
      this.triggerEvent('change', { count: this.data.count });
    }
  }
});
```

---

## 注意事项

1. **域名配置**:request 域名需在小程序后台配置
2. **HTTPS 要求**:所有网络请求必须使用 HTTPS
3. **代码包大小**:主包限制 2MB,总分包限制 20MB
4. **用户隐私**:使用地理位置等敏感接口需声明

---

## 参考资源

- [微信小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/framework/quickstart/)
- [小程序组件参考](https://developers.weixin.qq.com/miniprogram/dev/component/)
- [小程序 API 参考](https://developers.weixin.qq.com/miniprogram/dev/api/)

## 参考资料

更多小程序文档请参考 `references/` 目录下的文档文件。

Popular in Development

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.