加入import別名讓import更好看
設定
- tsconfig.json
{ "compilerOptions": { ... "baseUrl": ".", "paths": { "@/components/*": ["src/components/*"], ... } }
- 使用
import Profile from "@/components/partial/Profile";
{ "compilerOptions": { ... "baseUrl": ".", "paths": { "@/components/*": ["src/components/*"], ... } }
import Profile from "@/components/partial/Profile";
@alanhc