TypeScript 安装

这个项目和组件是用 TypeScript 编写的。我们建议你在你的项目中也使用 TypeScript。

然而,我们也提供了组件的 JavaScript 版本。JavaScript 版本可以通过 cli 获取。

如果你不想使用 TypeScript,可以在 components.json 文件中使用 tsx 标志来禁用。

components.json

  1. {
  2. "style": "default",
  3. "tailwind": {
  4. "config": "tailwind.config.js",
  5. "css": "src/app/globals.css",
  6. "baseColor": "zinc",
  7. "cssVariables": true
  8. },
  9. "rsc": false,
  10. "tsx": false,
  11. "aliases": {
  12. "utils": "~/lib/utils",
  13. "components": "~/components"
  14. }
  15. }

要配置导入别名,你可以使用以下 jsconfig.json

jsconfig.json

  1. {
  2. "compilerOptions": {
  3. "paths": {
  4. "@/*": ["./*"]
  5. }
  6. }
  7. }