correct Docs

This commit is contained in:
2026-03-27 16:29:31 +01:00
parent 25481a2201
commit f3aa49a100
3 changed files with 13 additions and 13 deletions

View File

@@ -54,8 +54,8 @@ Thanks to **SigPro's synchronous initialization**, you no longer need to wrap yo
import { $ } from 'sigpro';
import { routes } from 'virtual:sigpro-routes';
// The Core already has $.router ready
$.mount($.router(routes), '#app');
// The Core already has $router ready
$mount($router(routes), '#app');
```
</div>
@@ -71,12 +71,12 @@ export default () => div({ class: 'layout' }, [
header([
h1("SigPro App"),
nav([
button({ onclick: () => $.router.go('/') }, "Home"),
button({ onclick: () => $.router.go('/blog') }, "Blog")
button({ onclick: () => $router.go('/') }, "Home"),
button({ onclick: () => $router.go('/blog') }, "Blog")
])
]),
// Only the content inside <main> will be swapped reactively
main($.router(routes))
main($router(routes))
]);
```
@@ -132,7 +132,7 @@ The plugin follows a simple convention to transform your file system into a rout
## 5. How it Works (Vite Virtual Module)
The plugin generates a virtual module named `virtual:sigpro-routes`. This module exports an array of objects compatible with `$.router()`:
The plugin generates a virtual module named `virtual:sigpro-routes`. This module exports an array of objects compatible with `$router()`:
```javascript
// Internal representation generated by the plugin