vant-vue3
Original:🇺🇸 English
Not Translated
Provides comprehensive guidance for Vant Vue 3 mobile component library including mobile components, themes, and best practices. Use when the user asks about Vant, needs to build mobile applications with Vue 3, or implement mobile UI components.
2installs
Added on
NPX Install
npx skill4agent add teachingai/full-stack-skills vant-vue3SKILL.md Content
When 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
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
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 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
API Reference
Detailed API documentation is available in the directory, organized to match the official Vant Vue 3.0 API documentation structure:
api/Components API (api/components.md
)
api/components.md- All component props and APIs
- Component events and slots
- Component types and interfaces
ConfigProvider API (api/config-provider.md
)
api/config-provider.md- ConfigProvider component API
- Global configuration options
- Theme configuration
Hooks 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/
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
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, 组件库, 按钮, 单元格, 表单, 对话框, 提示, 弹出层, 标签页, 标签栏, 导航栏, 主题定制, 国际化