Basic Svelte
Introduction
Bindings
Advanced Svelte
Advanced reactivity
Motion
Advanced bindings
Advanced transitions
Context API
Special elements
<script module>
Next steps
Basic SvelteKit
Introduction
Routing
Loading data
Headers and cookies
Shared modules
API routes
$app/state
Errors and redirects
Advanced SvelteKit
Page options
Link options
Advanced routing
Advanced loading
Environment variables
Conclusion
Ordinarily, SvelteKit will navigate between pages without refreshing the page. In this exercise, if we navigate between /
and /about
, the timer keeps on ticking.
In rare cases, you might want to disable this behaviour. You can do so by adding the data-sveltekit-reload
attribute on an individual link, or any element that contains links:
src/routes/+layout
<nav data-sveltekit-reload>
<a href="/">home</a>
<a href="/about">about</a>
</nav>
For more information on available link options and their values, consult the link options documentation.
previous next
1
2
3
<h1>home</h1>
<p>this is the home page.</p>