--- name: tdesign-vue-next description: TDesign Vue 3 component library usage guide, covering tdesign-vue-next 1.x series, including basic components, forms, tables, theme customization, dark mode, and AI Chat components --- # TDesign Vue Next ## S - Scope - **Target**: `tdesign-vue-next@^1` with Vue 3.3+ - **Cover**: Basic components, layout components, navigation components, input components, data display components, feedback components, theme customization, dark mode, Chat component - **Avoid**: Undocumented internal APIs, DOM manipulation hacks, other TDesign tech stacks (React/Miniprogram) ### Default assumptions (when not explicitly specified) - **Language**: TypeScript + ` ``` ### 4) Component selection rules | Scenario | Recommended Component | Notes | | ---------------------- | ---------------------------------- | ---------------------------------------------- | | Simple list display | `List` | Small data, no complex interaction | | Complex data table | `Table` | Supports sorting, filtering, pagination | | Large data table | `Table` + `virtual-scroll` | Enable virtual scroll | | Tree data selection | `TreeSelect` | Single/multiple tree selection | | Cascading selection | `Cascader` | Multi-level linked selection | | Simple dropdown | `Select` | Moderate number of options | | Remote search select | `Select` + `filterable` + `remote` | Disable local filtering | | File upload | `Upload` | Supports drag, multi-file | | Form collection | `Form` + `FormItem` | Unified validation and submit | | Light notification | `Message` | Operation feedback, auto-dismiss | | Important notification | `Notification` | Requires user confirmation or contains actions | | Confirmation action | `Dialog` / `Popconfirm` | Choose based on context | | Side panel details | `Drawer` | Without interrupting page flow | | AI conversation | `Chat` | Streaming messages, multi-turn dialogue | ### 5) Form decision chain ``` Need to collect user input? ├── Yes → Use Form wrapper │ ├── Need dynamic add/remove fields? → See form-advanced.md │ ├── Need cross-field linking? → See form-advanced.md │ └── Simple form → Use FormItem + rules └── No → Use input component directly ``` ### 6) Table decision chain ``` Need to display list data? ├── Data > 1000 rows? → Enable virtual scroll, see table-advanced.md ├── Need server-side pagination/sorting? → See table-advanced.md ├── Need editable cells? → See table-advanced.md └── Simple table → Use Table + columns + data ``` ### 7) Theme customization decision chain ``` Need to customize theme? ├── Only modify brand color → ConfigProvider theme prop ├── Modify multiple tokens → Override CSS variables ├── Deep customization → See theming-advanced.md └── Dark mode → See dark-mode.md ``` ### 8) Route complex scenarios to `Reference` When identifying trigger conditions from the Complex triggers table, must: 1. Inform user this is a complex scenario 2. Open the corresponding Reference document 3. Provide suggestions based on recommended patterns in Reference ### 9) Accessibility and performance checks - Ensure form controls have appropriate `label` - Enable virtual scroll or pagination for large data scenarios - Avoid complex calculations in `template`, use `computed` - Ensure stable `key` for list rendering --- ## O - Output ### Output should include (as needed) 1. **Component recommendation**: Component name and selection rationale 2. **Minimal configuration**: Required ConfigProvider setup 3. **Code example**: Directly runnable ` ``` ### Official Resources - Official Documentation: https://tdesign.tencent.com/vue-next/overview - GitHub: https://github.com/Tencent/tdesign-vue-next - Design Specifications: https://tdesign.tencent.com/design/values