routeurs c fait, mais depuis mon windows avec des #. jsp si ca marchera sur dwarves. d'apres claude, il me suffira de copier coller un repertoire dist/ ... jespere que ce sera le cas, car je n'aurais pas vrmt le temps ni, surtt, le materiel pr tester ca avant la soutenance.
This commit is contained in:
@@ -1,4 +1,29 @@
|
||||
import { component } from 'riot'
|
||||
import { component, unmount } from 'riot'
|
||||
import App from './components/app.riot'
|
||||
import PageDetail from './components/page-detail.riot'
|
||||
|
||||
component(App)(document.getElementById('app'))
|
||||
const app = document.getElementById('app')
|
||||
let currentComponent = null
|
||||
|
||||
function navigate()
|
||||
{
|
||||
const hash = window.location.hash
|
||||
|
||||
if (currentComponent)
|
||||
{
|
||||
unmount(app, true)
|
||||
}
|
||||
|
||||
if (hash.startsWith('#/formation/'))
|
||||
{
|
||||
const id = hash.replace('#/formation/', '')
|
||||
currentComponent = component(PageDetail)(app, { id })
|
||||
}
|
||||
else
|
||||
{
|
||||
currentComponent = component(App)(app)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', navigate)
|
||||
navigate()
|
||||
Reference in New Issue
Block a user