Skip to content
Discussion options

You must be logged in to vote

Do you mean from the <script> tag of a .svelte file?

You can import the page store from $app/stores then call it to get the params and route id:

<script lang="ts">
    import {page} from `$app/stores`;

</script>

<h1>Route: {$page.route.id}</h1>
<h1>Params: {JSON.stringify($page.url.searchParams.getAll('hello'))}</h1>

https://learn.svelte.dev/tutorial/page-store

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by baiwusanyu-c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants