naive-ui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNaive UI Practices
Naive UI 实践指南
Usage guide for Naive UI and Vue 3 applications. Contains 33 rules across 8 categories, prioritized by impact to guide automated refactoring, component creation, and troubleshooting.
这是一份针对Naive UI与Vue 3应用的使用指南,包含8个分类下的33条规则,按影响优先级排序,可指导自动化重构、组件创建及问题排查。
When to Apply
适用场景
Reference these guidelines when:
- Writing new Vue 3 components using Naive UI
- Implementing forms and data validation
- Handling large datasets with virtual scrolling (DataTable, Tree, Select)
- Customizing application themes and dark mode
- Troubleshooting Naive UI usage issues and styling conflicts
在以下场景可参考本指南:
- 使用Naive UI编写新的Vue 3组件时
- 实现表单与数据验证时
- 使用虚拟滚动处理大型数据集时(DataTable、Tree、Select)
- 自定义应用主题与深色模式时
- 排查Naive UI使用问题与样式冲突时
Rule Categories by Priority
按优先级划分的规则分类
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Core Configuration | CRITICAL | |
| 2 | Form & Data Input | CRITICAL | |
| 3 | Complex Data Display | HIGH | |
| 4 | Feedback & Overlay | HIGH | |
| 5 | Layout & Navigation | MEDIUM | |
| 6 | Basic Data Display | MEDIUM | |
| 7 | Advanced Customization | LOW-MEDIUM | |
| 8 | Ecosystem & Troubleshooting | LOW | |
| 优先级 | 分类 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | 核心配置 | 关键 | |
| 2 | 表单与数据输入 | 关键 | |
| 3 | 复杂数据展示 | 高 | |
| 4 | 反馈与浮层 | 高 | |
| 5 | 布局与导航 | 中 | |
| 6 | 基础数据展示 | 中 | |
| 7 | 高级定制 | 低-中 | |
| 8 | 生态与问题排查 | 低 | |
Quick Reference
快速参考
1. Core Configuration (CRITICAL)
1. 核心配置(关键)
- - Auto-import setup, global config, providers
core-setup - - Theme overrides, dark mode, CSS variables, useThemeVars
core-theme - - Import on demand and tree shaking
core-import-on-demand - - Nuxt.js integration best practices
core-nuxtjs - - Server-Side Rendering guidelines
core-ssr - - Potential style conflict resolution
core-style-conflict
- - 自动导入setup、全局配置、提供者
core-setup - - 主题覆盖、深色模式、CSS变量、useThemeVars
core-theme - - 按需导入与摇树优化
core-import-on-demand - - Nuxt.js集成最佳实践
core-nuxtjs - - 服务端渲染指南
core-ssr - - 潜在样式冲突解决方案
core-style-conflict
2. Form & Data Input (CRITICAL)
2. 表单与数据输入(关键)
- - Validation rules, dynamic forms, array fields
component-form-validation - - Layout, validation, dynamic fields, nested forms
component-form - - Formatted input, precision, validation triggers
component-input - - Filterable, multiple, tags, async search, custom render
component-select - - Date ranges, shortcuts, formatting, timezone
component-datepicker - - Custom request, file handling, drag drop
component-upload
- - 验证规则、动态表单、数组字段
component-form-validation - - 布局、验证、动态字段、嵌套表单
component-form - - 格式化输入、精度控制、验证触发
component-input - - 可筛选、多选、标签、异步搜索、自定义渲染
component-select - - 日期范围、快捷选项、格式化、时区
component-datepicker - - 自定义请求、文件处理、拖拽上传
component-upload
3. Complex Data Display (HIGH)
3. 复杂数据展示(高)
- - Virtual scroll, remote data, sorting, filtering, fixed columns
component-datatable - - Async loading, checkable, controlled state, large dataset handling
component-tree - - Virtual scrolling patterns
component-virtual-list
- - 虚拟滚动、远程数据、排序、筛选、固定列
component-datatable - - 异步加载、可勾选、受控状态、大型数据集处理
component-tree - - 虚拟滚动模式
component-virtual-list
4. Feedback & Overlay (HIGH)
4. 反馈与浮层(高)
- - Form modals, draggable, focus management, async close
component-modal - - Programmatic API, global methods (Message, Notification)
component-feedback - - Alert, Skeleton, Spin, LoadingBar, Popconfirm
component-feedback-alert
- - 表单模态框、可拖拽、焦点管理、异步关闭
component-modal - - 程序化API、全局方法(Message、Notification)
component-feedback - - 警告框、骨架屏、加载动画、进度条、确认弹窗
component-feedback-alert
5. Layout & Navigation (MEDIUM)
5. 布局与导航(中)
- - Layout, Grid, Flex, Space, Card, Divider
component-layout - - Menu, Dropdown, Breadcrumb, Tabs
component-menu - - Steps, Timeline, Pagination, Anchor, BackTop
component-navigation-steps
- - 布局、网格、弹性布局、间距、卡片、分割线
component-layout - - 菜单、下拉菜单、面包屑、标签页
component-menu - - 步骤条、时间线、分页、锚点、返回顶部
component-navigation-steps
6. Basic Data Display (MEDIUM)
6. 基础数据展示(中)
- - Image, List, Descriptions, Calendar, Time, Countdown
component-data-display - - Badge, Tag, Avatar, Progress, Statistic, Result, Empty
component-display - - Button variants, loading, icons
component-button - - Radio, Checkbox, Switch, Slider, Rate, ColorPicker
component-selection
- - 图片、列表、描述、日历、时间、倒计时
component-data-display - - 徽章、标签、头像、进度条、统计、结果页、空状态
component-display - - 按钮变体、加载状态、图标
component-button - - 单选框、复选框、开关、滑块、评分、颜色选择器
component-selection
7. Advanced Customization (LOW-MEDIUM)
7. 高级定制(低-中)
- - Customizing theme extensively
core-customize-theme - - Configuring fonts
core-fonts - - Internationalization
core-i18n - - Controlled manner & uncontrolled manner
core-controlled-uncontrolled
- - 深度定制主题
core-customize-theme - - 字体配置
core-fonts - - 国际化
core-i18n - - 受控与非受控模式
core-controlled-uncontrolled
8. Ecosystem & Troubleshooting (LOW)
8. 生态与问题排查(低)
- - Common issues and quick fixes
core-troubleshooting - - Installation guidelines
core-installation - - JSX & TSX usage
core-jsx - - Using UMD build
core-umd - - Usage in SFC
core-usage-sfc - - Vite SSG/SSE integration
core-vite-ssge - - Vitepress integration
core-vitepress - - Experimental features
core-experimental-features
- - 常见问题与快速修复
core-troubleshooting - - 安装指南
core-installation - - JSX与TSX使用方法
core-jsx - - UMD构建版本使用
core-umd - - 单文件组件(SFC)中使用
core-usage-sfc - - Vite SSG/SSE集成
core-vite-ssge - - Vitepress集成
core-vitepress - - 实验性功能
core-experimental-features
How to Use
使用方法
Read individual rule files for detailed explanations and code examples:
references/core-setup.md
references/component-datatable.mdEach rule file contains:
- Specific implementation details
- Code examples for Vue 3 setup script
- Warning notes and prerequisites
- Relevant TypeScript interfaces
阅读单个规则文件获取详细说明与代码示例:
references/core-setup.md
references/component-datatable.md每个规则文件包含:
- 具体实现细节
- Vue 3 setup脚本的代码示例
- 注意事项与前置要求
- 相关TypeScript接口
Full Compiled Document
完整编译文档
For the complete guide with all rules expanded:
AGENTS.md如需查看包含所有展开规则的完整指南,请参考:
AGENTS.md