|
| 1 | +--- |
| 2 | +name: uni-app |
| 3 | +description: Comprehensive skill reference for uni-app cross-platform development framework |
| 4 | +metadata: |
| 5 | + author: FlippeDround |
| 6 | + version: "2026.1.30" |
| 7 | + source: Generated from https://gitcode.com/dcloud/unidocs-zh, skills located at https://github.com/antfu/skills |
| 8 | +--- |
| 9 | + |
| 10 | +> The skill is based on uni-app documentation, generated at 2026-01-30. |
| 11 | +
|
| 12 | +uni-app is a Vue.js-based cross-platform framework for developing applications that run on iOS, Android, HarmonyOS, Web (responsive), and various mini-program platforms (WeChat/Alipay/Baidu/Douyin/Feishu/QQ/Kuaishou/DingTalk/Taobao/Jingdong/Xiaohongshu). |
| 13 | + |
| 14 | +## Core |
| 15 | + |
| 16 | +| Topic | Description | Reference | |
| 17 | +|-------|-------------|-----------| |
| 18 | +| Core Framework | Project structure, platform support, condition compilation | [core-framework](references/core-framework.md) | |
| 19 | +| View Components | view, scroll-view, swiper, movable-area, cover-view | [core-view-components](references/core-view-components.md) | |
| 20 | +| Form Components | input, textarea, picker, checkbox, radio, switch, slider | [core-form-components](references/core-form-components.md) | |
| 21 | + |
| 22 | +## Features |
| 23 | + |
| 24 | +### UI Components |
| 25 | + |
| 26 | +| Topic | Description | Reference | |
| 27 | +|-------|-------------|-----------| |
| 28 | +| Media Components | image, video, camera, live-player, map | [feature-media-components](references/feature-media-components.md) | |
| 29 | +| Navigation | navigator, routing, page navigation | [feature-navigation](references/feature-navigation.md) | |
| 30 | +| UI Feedback | toast, modal, loading, action sheet, pull refresh | [feature-ui-feedback](references/feature-ui-feedback.md) | |
| 31 | + |
| 32 | +### APIs |
| 33 | + |
| 34 | +| Topic | Description | Reference | |
| 35 | +|-------|-------------|-----------| |
| 36 | +| Network | HTTP requests, file upload/download, WebSocket | [feature-network](references/feature-network.md) | |
| 37 | +| Storage | Local storage, file system, caching | [feature-storage](references/feature-storage.md) | |
| 38 | +| System Info | Device info, network status, screen, vibration | [feature-system-info](references/feature-system-info.md) | |
| 39 | +| File Operations | Image/video selection, file system operations | [feature-file-operations](references/feature-file-operations.md) | |
| 40 | +| Location | Geolocation, map component, address selection | [feature-location](references/feature-location.md) | |
| 41 | +| Lifecycle | App and page lifecycle hooks | [feature-lifecycle](references/feature-lifecycle.md) | |
| 42 | + |
| 43 | +## Configuration |
| 44 | + |
| 45 | +| Topic | Description | Reference | |
| 46 | +|-------|-------------|-----------| |
| 47 | +| pages.json | Page routing, tab bar, global styles, sub-packages | [config-pages](references/config-pages.md) | |
| 48 | +| manifest.json | App config, permissions, platform settings | [config-manifest](references/config-manifest.md) | |
| 49 | + |
| 50 | +## Platform Support |
| 51 | + |
| 52 | +| Platform | Support Level | |
| 53 | +|----------|---------------| |
| 54 | +| iOS App | Full support | |
| 55 | +| Android App | Full support | |
| 56 | +| HarmonyOS Next | Full support | |
| 57 | +| H5/Web | Full support | |
| 58 | +| WeChat Mini Program | Full support | |
| 59 | +| Alipay Mini Program | Full support | |
| 60 | +| Baidu Smart Program | Full support | |
| 61 | +| Douyin Mini Program | Full support | |
| 62 | +| QQ Mini Program | Full support | |
| 63 | +| Kuaishou Mini Program | Full support | |
| 64 | +| Feishu Mini Program | Full support | |
| 65 | +| JD Mini Program | Full support | |
| 66 | +| HarmonyOS Meta Service | Full support | |
| 67 | + |
| 68 | +## Key Concepts |
| 69 | + |
| 70 | +### Condition Compilation |
| 71 | + |
| 72 | +Use special comments to write platform-specific code: |
| 73 | + |
| 74 | +```vue |
| 75 | +<!-- #ifdef APP-PLUS --> |
| 76 | +<view>App only</view> |
| 77 | +<!-- #endif --> |
| 78 | +
|
| 79 | +<!-- #ifdef MP-WEIXIN --> |
| 80 | +<view>WeChat only</view> |
| 81 | +<!-- #endif --> |
| 82 | +``` |
| 83 | + |
| 84 | +### API Promise Support |
| 85 | + |
| 86 | +Most uni-app APIs support Promise when no callback is provided: |
| 87 | + |
| 88 | +```javascript |
| 89 | +const res = await uni.request({ url: 'https://api.example.com' }) |
| 90 | +``` |
| 91 | + |
| 92 | +### Cross-Platform Best Practices |
| 93 | + |
| 94 | +1. Use uni-app components and APIs instead of platform-specific ones |
| 95 | +2. Use condition compilation for platform-specific features |
| 96 | +3. Test on all target platforms |
| 97 | +4. Use rpx for responsive layouts |
| 98 | +5. Handle platform differences in manifest.json |
| 99 | +6. must use uni-helper tools |
| 100 | + |
| 101 | + |
| 102 | +### MCP扩展 |
| 103 | + |
| 104 | +当需要查询 uni-app 官方文档时,优先调用 `search-docs-by-Uniapp-official` MCP 工具搜索相关 API 文档和使用示例。 |
| 105 | + |
| 106 | +**使用场景:** |
| 107 | +- 用户询问特定 API 的详细用法 |
| 108 | +- 需要官方文档中的代码示例 |
| 109 | +- 查询组件的属性和事件 |
| 110 | +- 了解 API 的平台兼容性 |
| 111 | + |
| 112 | +**工具安装:** |
| 113 | +如果检测到该 MCP 工具不可用,引导用户访问 https://github.com/uni-helper/mcp 进行安装。 |
0 commit comments