name: uview-vue2 description: 提供uView Vue 2组件库的全面指导,包括组件、工具和布局。当用户询问uView for Vue 2、需要使用uView构建Vue 2应用程序或使用uView组件时使用。 license: 完整条款见LICENSE.txt
何时使用此技能
每当用户希望时使用此技能:
- 使用uView UI组件构建uni-app应用程序
- 使用uView UI组件(按钮、输入框、表单、表格、模态框等)
- 使用uView UI工具($u.toast、$u.http等)
- 自定义uView UI主题
- 将uView UI与uni-app集成
- 使用uView UI创建响应式布局
- 使用uView UI表单组件
- 使用uView UI组件显示数据
- 使用uView UI处理导航
- 使用uView UI实用程序和助手
如何使用此技能
此技能组织以匹配uView UI官方文档结构(https://www.uviewui.com/guide/demo.html, https://www.uviewui.com/components/intro.html)。使用uView UI时:
-
从用户请求中识别主题:
- 快速开始 →
examples/getting-started/installation.md或examples/getting-started/basic-usage.md - 按钮 →
examples/components/button.md - 输入框 →
examples/components/input.md - 表单 →
examples/components/form.md - 表格 →
examples/components/table.md - 模态框 →
examples/components/modal.md - 提示 →
examples/tools/toast.md - 请求 →
examples/tools/http.md - 主题 →
examples/advanced/theme-customization.md
- 快速开始 →
-
从
examples/目录加载适当的示例文件:快速开始 -
examples/getting-started/:examples/getting-started/installation.md- 安装uView UI和基本设置examples/getting-started/basic-usage.md- 基本组件用法examples/getting-started/design-principles.md- 设计原则和最佳实践
组件 -
examples/components/:examples/components/button.md- 按钮组件examples/components/input.md- 输入框组件examples/components/form.md- 表单组件examples/components/table.md- 表格组件examples/components/modal.md- 模态框组件examples/components/toast.md- 提示组件examples/components/loading.md- 加载组件examples/components/picker.md- 选择器组件examples/components/tabs.md- 选项卡组件examples/components/navbar.md- 导航栏组件examples/components/grid.md- 网格组件examples/components/card.md- 卡片组件examples/components/badge.md- 徽章组件examples/components/swiper.md- 轮播组件examples/components/list.md- 列表组件
工具 -
examples/tools/:examples/tools/toast.md- 提示工具($u.toast)examples/tools/http.md- HTTP工具($u.http)examples/tools/storage.md- 存储工具($u.storage)examples/tools/route.md- 路由工具($u.route)examples/tools/debounce.md- 防抖工具examples/tools/throttle.md- 节流工具
高级 -
examples/advanced/:examples/advanced/theme-customization.md- 自定义uView UI主题examples/advanced/uniapp-integration.md- UniApp集成
-
遵循该示例文件中的具体指令,包括语法、结构和最佳实践
重要注意事项:
- 所有示例遵循uView UI Vue 2.0 API
- 示例使用uni-app语法
- 每个示例文件包括关键概念、代码示例和要点
- 始终检查示例文件以获取最佳实践和常见模式
- uView UI专为uni-app(H5、小程序、App)设计
-
必要时参考
api/目录中的API文档:api/components.md- 组件API参考api/tools.md- 工具API参考($u方法)api/theme-variables.md- 主题变量API
-
使用
templates/目录中的模板:templates/project-setup.md- 项目设置模板templates/component-template.md- 组件使用模板
文档映射(与官方文档一一对应)
指南:
- 查看
examples/guide/或examples/getting-started/中的指南文件 → https://www.uviewui.com/guide/demo.html
组件:
- 查看
examples/components/中的组件文件 → https://www.uviewui.com/components/intro.html
示例和模板
此技能包括详细示例,组织以匹配官方文档结构。所有示例都在examples/目录中(见上述映射)。
使用示例:
- 从用户请求中识别主题
- 从上述映射加载适当的示例文件
- 遵循该文件中的指令、语法和最佳实践
- 根据您的具体用例调整代码示例
使用模板:
- 参考
templates/目录中的常见脚手架模板 - 根据您的具体需求和编码风格调整模板
API参考
详细的API文档可在api/目录中找到,组织以匹配官方uView UI API文档结构:
组件API(api/components.md)
- 所有组件属性和API
- 组件事件和插槽
- 组件类型和接口
工具API(api/tools.md)
- $u对象方法
- Toast、Http、Storage、Route工具
- 实用函数
主题变量API(api/theme-variables.md)
- SCSS变量
- 主题自定义变量
- 颜色变量
使用API参考:
- 识别您需要帮助的API
- 从
api/目录加载相应的API文件 - 查找API签名、参数、返回类型和示例
- 参考链接的示例文件以获取详细使用模式
- 所有API文件包括指向
examples/目录中相关示例文件的链接
最佳实践
- 导入uView UI:在main.js中使用Vue.use()导入uView UI
- 导入样式:在App.vue中导入uView UI样式
- 使用easycom:在pages.json中配置easycom以实现自动组件注册
- 使用$u工具:使用$u对象进行实用函数
- 主题自定义:通过SCSS变量自定义主题
- UniApp兼容性:在多个平台(H5、小程序、App)上测试
- 响应式设计:使用rpx单位进行响应式布局
- 组件组合:组合组件以构建复杂UI
- 性能:为uni-app性能优化
- 无障碍性:遵循uni-app无障碍指南
资源
- 官方网站:https://www.uviewui.com/
- 快速开始:https://www.uviewui.com/guide/demo.html
- 组件:https://www.uviewui.com/components/intro.html
- UniApp插件:https://ext.dcloud.net.cn/plugin?id=1593
- GitHub仓库:https://github.com/umicro/uView
关键词
uView UI, uView, uni-app, Vue 2, 组件, 按钮, 输入框, 表单, 表格, 模态框, 提示, 工具函数, 主题定制, 组件库