vant-vue3
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用本技能
Use this skill whenever the user wants to:
- Build mobile Vue 3 applications with Vant components
- Use Vant UI components (Button, Cell, Form, Dialog, Toast, etc.)
- Create mobile-friendly interfaces
- Customize Vant theme
- Implement internationalization with Vant
- Use Vant with TypeScript
- Handle mobile gestures and interactions
- Implement mobile navigation patterns
- Use mobile form components
- Create mobile data display components
当用户有以下需求时,可使用本技能:
- 使用Vant组件构建Vue 3移动端应用
- 使用Vant UI组件(Button、Cell、Form、Dialog、Toast等)
- 创建适配移动端的界面
- 自定义Vant主题
- 基于Vant实现国际化
- 在Vant中使用TypeScript
- 处理移动端手势与交互
- 实现移动端导航模式
- 使用移动端表单组件
- 创建移动端数据展示组件
How to use this skill
如何使用本技能
This skill is organized to match the Vant Vue 3.0 official documentation structure (https://vant-ui.github.io/vant/#/zh-CN). When working with Vant:
-
Identify the topic from the user's request:
- Getting started/快速开始 → or
examples/getting-started/installation.mdexamples/getting-started/basic-usage.md - Button/按钮 →
examples/components/button.md - Cell/单元格 →
examples/components/cell.md - Form/表单 →
examples/components/form.md - Dialog/对话框 →
examples/components/dialog.md - Toast/提示 →
examples/components/toast.md - Popup/弹出层 →
examples/components/popup.md - Theme/主题 →
examples/advanced/theme-customization.md
- Getting started/快速开始 →
-
Load the appropriate example file from thedirectory:
examples/Getting Started (快速开始) -:examples/getting-started/- - Installing Vant and basic setup
examples/getting-started/installation.md - - Basic component usage
examples/getting-started/basic-usage.md
Components (组件) -:examples/components/- - Button component
examples/components/button.md - - Cell component
examples/components/cell.md - - Icon component
examples/components/icon.md - - Image component
examples/components/image.md - - Popup component
examples/components/popup.md - - Toast component
examples/components/toast.md - - Dialog component
examples/components/dialog.md - - Form component
examples/components/form.md - - Field component
examples/components/field.md - - Picker component
examples/components/picker.md - - Calendar component
examples/components/calendar.md - - Tabs component
examples/components/tabs.md - - Tabbar component
examples/components/tabbar.md - - Navbar component
examples/components/navbar.md - - List component
examples/components/list.md - - Grid component
examples/components/grid.md - - Card component
examples/components/card.md - - Badge component
examples/components/badge.md - - Loading component
examples/components/loading.md - - ActionSheet component
examples/components/action-sheet.md
Advanced (高级) -:examples/advanced/- - Customizing Vant theme
examples/advanced/theme-customization.md - - Internationalization setup
examples/advanced/internationalization.md - - TypeScript support
examples/advanced/typescript.md
-
Follow the specific instructions in that example file for syntax, structure, and best practicesImportant Notes:
- All examples follow Vant Vue 3.0 API
- Examples use Composition API syntax
- Each example file includes key concepts, code examples, and key points
- Always check the example file for best practices and common patterns
- Vant is optimized for mobile devices
-
Reference API documentation in thedirectory when needed:
api/- - Component API reference
api/components.md - - ConfigProvider API
api/config-provider.md - - Composition Hooks API
api/hooks.md
-
Use templates from thedirectory:
templates/- - Project setup templates
templates/project-setup.md - - Component usage templates
templates/component-template.md
本技能的结构与Vant Vue 3.0官方文档结构(https://vant-ui.github.io/vant/#/zh-CN)保持一致。使用Vant时:
-
从用户的需求中确定主题:
- 快速开始 → 或
examples/getting-started/installation.mdexamples/getting-started/basic-usage.md - Button/按钮 →
examples/components/button.md - Cell/单元格 →
examples/components/cell.md - Form/表单 →
examples/components/form.md - Dialog/对话框 →
examples/components/dialog.md - Toast/提示 →
examples/components/toast.md - Popup/弹出层 →
examples/components/popup.md - Theme/主题 →
examples/advanced/theme-customization.md
- 快速开始 →
-
从目录加载对应的示例文件:
examples/快速开始 -:examples/getting-started/- - Vant安装与基础配置
examples/getting-started/installation.md - - 组件基础使用方法
examples/getting-started/basic-usage.md
组件 -:examples/components/- - Button组件
examples/components/button.md - - Cell组件
examples/components/cell.md - - Icon组件
examples/components/icon.md - - Image组件
examples/components/image.md - - Popup组件
examples/components/popup.md - - Toast组件
examples/components/toast.md - - Dialog组件
examples/components/dialog.md - - Form组件
examples/components/form.md - - Field组件
examples/components/field.md - - Picker组件
examples/components/picker.md - - Calendar组件
examples/components/calendar.md - - Tabs组件
examples/components/tabs.md - - Tabbar组件
examples/components/tabbar.md - - Navbar组件
examples/components/navbar.md - - List组件
examples/components/list.md - - Grid组件
examples/components/grid.md - - Card组件
examples/components/card.md - - Badge组件
examples/components/badge.md - - Loading组件
examples/components/loading.md - - ActionSheet组件
examples/components/action-sheet.md
高级用法 -:examples/advanced/- - 自定义Vant主题
examples/advanced/theme-customization.md - - 国际化配置
examples/advanced/internationalization.md - - TypeScript支持
examples/advanced/typescript.md
-
遵循示例文件中的具体说明,包括语法、结构及最佳实践重要说明:
- 所有示例均遵循Vant Vue 3.0 API
- 示例使用Composition API语法
- 每个示例文件包含核心概念、代码示例及关键点
- 请务必查看示例文件以获取最佳实践和通用模式
- Vant针对移动设备进行了优化
-
必要时参考目录下的API文档:
api/- - 组件API参考
api/components.md - - ConfigProvider API
api/config-provider.md - - 组合式Hooks API
api/hooks.md
-
使用目录下的模板:
templates/- - 项目搭建模板
templates/project-setup.md - - 组件使用模板
templates/component-template.md
Doc mapping (one-to-one with official documentation)
文档映射(与官方文档一一对应)
Guide (指南):
- See guide files in or
examples/guide/→ https://vant-ui.github.io/vant/#/zh-CNexamples/getting-started/
Components (组件):
- See component files in → https://vant-ui.github.io/vant/#/zh-CN
examples/components/
指南:
- 请查看或
examples/guide/下的指南文件 → https://vant-ui.github.io/vant/#/zh-CNexamples/getting-started/
组件:
- 请查看下的组件文件 → https://vant-ui.github.io/vant/#/zh-CN
examples/components/
Examples and Templates
示例与模板
This skill includes detailed examples organized to match the official documentation structure. All examples are in the directory (see mapping above).
examples/To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in directory for common scaffolding
templates/ - Adapt templates to your specific needs and coding style
本技能包含与官方文档结构匹配的详细示例,所有示例均位于目录下(详见上述映射)。
examples/使用示例:
- 从用户需求中确定主题
- 根据上述映射加载对应的示例文件
- 遵循文件中的语法、结构及最佳实践说明
- 根据具体使用场景调整代码示例
使用模板:
- 参考目录下的模板进行通用脚手架搭建
templates/ - 根据具体需求和编码风格调整模板
API Reference
API参考
Detailed API documentation is available in the directory, organized to match the official Vant Vue 3.0 API documentation structure:
api/详细的API文档位于目录下,结构与Vant Vue 3.0官方API文档保持一致:
api/Components API (api/components.md
)
api/components.md组件API(api/components.md
)
api/components.md- All component props and APIs
- Component events and slots
- Component types and interfaces
- 所有组件的属性与API
- 组件事件与插槽
- 组件类型与接口
ConfigProvider API (api/config-provider.md
)
api/config-provider.mdConfigProvider API(api/config-provider.md
)
api/config-provider.md- ConfigProvider component API
- Global configuration options
- Theme configuration
- ConfigProvider组件API
- 全局配置选项
- 主题配置
Hooks API (api/hooks.md
)
api/hooks.mdHooks API(api/hooks.md
)
api/hooks.md- Composition hooks (useClickAway, useWindowSize, etc.)
- Utility hooks
To use API reference:
- Identify the API you need help with
- Load the corresponding API file from the directory
api/ - Find the API signature, parameters, return type, and examples
- Reference the linked example files for detailed usage patterns
- All API files include links to relevant example files in the directory
examples/
- 组合式Hooks(useClickAway、useWindowSize等)
- 工具类Hooks
使用API参考:
- 确定所需的API
- 从目录加载对应的API文件
api/ - 查找API签名、参数、返回类型及示例
- 参考关联的示例文件获取详细使用模式
- 所有API文件均包含指向目录中相关示例文件的链接
examples/
Best Practices
最佳实践
- Import Vant CSS: Import Vant CSS in your entry file
- Use Composition API: Prefer Composition API for Vue 3 projects
- Tree-shaking: Import components individually for better tree-shaking
- Mobile-first: Design for mobile devices first
- Touch interactions: Consider touch gestures and interactions
- Performance: Optimize for mobile performance
- Theme customization: Use CSS variables for consistent theming
- Internationalization: Use ConfigProvider with locale for i18n
- TypeScript: Use TypeScript for better type safety
- Component composition: Compose components for complex UIs
- 导入Vant CSS:在入口文件中导入Vant CSS
- 使用Composition API:Vue 3项目优先使用Composition API
- Tree-shaking:按需导入组件以实现更优的Tree-shaking效果
- 移动端优先:优先针对移动设备进行设计
- 触摸交互:考虑触摸手势与交互体验
- 性能优化:针对移动端性能进行优化
- 主题定制:使用CSS变量实现统一主题
- 国际化:结合ConfigProvider与locale实现国际化
- TypeScript:使用TypeScript提升类型安全性
- 组件组合:通过组件组合构建复杂UI
Resources
资源
- Official Website: https://vant-ui.github.io/
- Documentation: https://vant-ui.github.io/vant/#/zh-CN
- GitHub Repository: https://github.com/youzan/vant
Keywords
关键词
Vant, Vant Vue 3, mobile UI, Vue 3, components, Button, Cell, Form, Dialog, Toast, Popup, Tabs, Tabbar, Navbar, theme, customization, internationalization, i18n, TypeScript, 组件库, 按钮, 单元格, 表单, 对话框, 提示, 弹出层, 标签页, 标签栏, 导航栏, 主题定制, 国际化
Vant, Vant Vue 3, mobile UI, Vue 3, components, Button, Cell, Form, Dialog, Toast, Popup, Tabs, Tabbar, Navbar, theme, customization, internationalization, i18n, TypeScript, 组件库, 按钮, 单元格, 表单, 对话框, 提示, 弹出层, 标签页, 标签栏, 导航栏, 主题定制, 国际化