Skip to content

Commit

Permalink
docs: add FAQ to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Nov 11, 2024
1 parent cc3821a commit 69e35f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ Config is loaded from `.tnfrc.ts` by default.
- `less: { modifyVars?: Record<string, string>; globalVars?: Record<string, string>; math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy' | number; sourceMap?: any; plugins?: (string | [string, Record<string, any>])[];}`: The configuration passed to lessLoader.
- `router: { defaultPreload?: 'intent' | 'render' | 'viewport'; defaultPreloadDelay?: number; devtool?: { options?: { initialIsOpen?: boolean; position?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' }; } | false }`: The router configuration.

## FAQ

### How to specify a redirect route?

You can use `redirect` function in loader to specify a redirect route.

```tsx
import { redirect, createFileRoute } from '@umijs/tnf/router';
const Route = createFileRoute('/foo')({
loader: async () => redirect({ to: '/bar' }),
});
```

## LICENSE

[MIT](LICENSE)

0 comments on commit 69e35f3

Please sign in to comment.