test route

This commit is contained in:
2024-06-29 00:45:19 +02:00
parent b0b2b8020a
commit 216b0658b8
3 changed files with 34 additions and 34 deletions

View File

@@ -13,7 +13,6 @@
<script src="https://unpkg.com/riot@9/riot+compiler.min.js"></script>
<script type="riot" src="./onzer.riot"></script>
<script type="riot" src="./playlists.riot"></script>
<script type="text/javascript">
async function fetch_data() {
@@ -22,26 +21,9 @@
});
}
function mountComponent(component) {
const app = document.getElementById('app');
app.innerHTML = '';
riot.mount(app, component);
}
riot.compile().then(async () => {
const data = await fetch_data();
route('/', () => {
riot.mount('onzer', { items: data });
});
route('/playlists', () => {
riot.mount('playlists');
});
router.start();
router.exec();
riot.mount('onzer', { items: data });
});
</script>