vite-riot-template/app/components/app.riot

32 lines
957 B
Plaintext

<app>
<section class="splash">
<router>
<div class="flex">
<a href="/">Home</a>
<img src="/assets/images/square.svg" />
<a href="/about">About</a>
</div>
</router>
<route each="{page in state.pages}" path="{page.path}">
<div is="{page.component}" {...page.props}></div>
</route>
</section>
<script>
import RiotWelcome from "../pages/riot-welcome.riot";
import RiotAbout from "../pages/riot-about.riot";
export default {
components: {
RiotWelcome,
RiotAbout
},
state: {
pages: [
{path: "/", component: "riot-welcome", props: {version: "9.x"}},
{path: "/about", component: "riot-about"},
]
}
}
</script>
</app>