You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,12 +43,13 @@ export default defineConfig({
43
43
For convenience, you may also wish to register aliases for importing the generated files into your application:
44
44
45
45
```ts
46
+
importpathfrom'path';
47
+
46
48
exportdefaultdefineConfig({
47
49
// ...
48
50
resolve: {
49
51
alias: {
50
-
"@actions/": "./resources/js/actions",
51
-
"@routes/": "./resources/js/routes",
52
+
"@": path.resolve(__dirname, "./resources/js"),
52
53
},
53
54
},
54
55
});
@@ -82,15 +83,15 @@ You can safely `.gitignore` the `wayfinder`, `actions`, and `routes` directories
82
83
Wayfinder functions return an object that contains the resolved URL and default HTTP method:
83
84
84
85
```ts
85
-
import { show } from"@actions/App/Http/Controllers/PostController";
86
+
import { show } from"@/actions/App/Http/Controllers/PostController";
86
87
87
88
show(1); // { url: "/posts/1", method: "get" }
88
89
```
89
90
90
91
If you just need the URL, or would like to choose a method from the HTTP methods defined on the server, you can invoke additional methods on the Wayfinder generated function:
91
92
92
93
```ts
93
-
import { show } from"@actions/App/Http/Controllers/PostController";
94
+
import { show } from"@/actions/App/Http/Controllers/PostController";
All Wayfinder methods accept an optional, final `options` argument to which you may pass a `query` object. This object can be used to append query parameters onto the resulting URL:
205
206
206
207
```ts
207
-
import { show } from"@actions/App/Http/Controllers/PostController";
208
+
import { show } from"@/actions/App/Http/Controllers/PostController";
0 commit comments