test route
This commit is contained in:
20
index.html
20
index.html
@@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user