Skip to content

Commit 3a0e6f5

Browse files
add routing ssr example (#271)
* add routing ssr example this problem is not really clear and i couldn't find anything in the doc or github issues and after poking so much around i found this solution and i thought it will help a lot of people * Use the Ziggy Vue plugin --------- Co-authored-by: Pascal Baljet <[email protected]>
1 parent 40961e3 commit 3a0e6f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

resources/js/Pages/routing.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ export default function () {
8888
<Link :href="route('users.create')">Create User</Link>
8989
`}
9090
/>
91+
<P>When <A href="/server-side-rendering">server-side rendering</A> is enabled, pass an options object to the Ziggy plugin in your <Code>ssr.js</Code> file, containing the route definitions and current location.</P>
92+
<CodeBlock
93+
language="js"
94+
children={dedent`
95+
.use(ZiggyVue, {
96+
...page.props.ziggy,
97+
location: new URL(page.props.ziggy.location),
98+
});
99+
`}
100+
/>
91101
</>
92102
)
93103
}

0 commit comments

Comments
 (0)