docs(agents): 更新 TypeScript/TSX 文件中图标自动导入的说明
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m22s

This commit is contained in:
严浩
2025-10-27 12:18:51 +08:00
parent 3269b10bfd
commit ad0df6b140

View File

@@ -29,7 +29,8 @@ Multiple auto-import systems are active:
- **Dynamic components**: Auto-imported components cannot be used with `<component :is="..." />` syntax - **Dynamic components**: Auto-imported components cannot be used with `<component :is="..." />` syntax
- ❌ Avoid: `<component :is="`icon-${name}`" />` - ❌ Avoid: `<component :is="`icon-${name}`" />`
- ✅ Use: `<icon-foo v-if="condition" />` with `v-if`/`v-else-if`/`v-else` directives - ✅ Use: `<icon-foo v-if="condition" />` with `v-if`/`v-else-if`/`v-else` directives
- **In TypeScript/TSX files**: Auto-import does NOT work. You must explicitly import icons using the `~icons/` prefix:
- **Icons in TypeScript/TSX files**: Auto-import for icons does NOT work. You must explicitly import them using the `~icons/` prefix:
```tsx ```tsx
import IconMenuRounded from '~icons/material-symbols/menu-rounded'; import IconMenuRounded from '~icons/material-symbols/menu-rounded';