Claude m'a aidé tout au long du projet, mais la ca atteint des sommets. En meme temps, je suis en retard de fou !! Heuresuement quil explique mega bien sinon je ne comprendrais rien... et encore, je comprends deja assez peu les lignes que je rentre moi meme. trop de balises tuent les balises......
This commit is contained in:
@@ -1,29 +1,44 @@
|
||||
import { component, unmount } from 'riot'
|
||||
import App from './components/app.riot'
|
||||
import PageDetail from './components/page-detail.riot'
|
||||
import Comparateur from './components/comparateur.riot'
|
||||
import 'chart.css'
|
||||
import './style.css'
|
||||
import EstimationChances from './components/estimation-chances.riot'
|
||||
|
||||
const app = document.getElementById('app')
|
||||
let currentComponent = null
|
||||
|
||||
function navigate()
|
||||
function navigate()
|
||||
{
|
||||
const hash = window.location.hash
|
||||
|
||||
if (currentComponent)
|
||||
if (currentComponent)
|
||||
{
|
||||
unmount(app, true)
|
||||
}
|
||||
|
||||
if (hash.startsWith('#/formation/'))
|
||||
if (hash.startsWith('#/formation/'))
|
||||
{
|
||||
const id = hash.replace('#/formation/', '')
|
||||
currentComponent = component(PageDetail)(app, { id })
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
else if (hash === '#/comparateur')
|
||||
{
|
||||
currentComponent = component(Comparateur)(app)
|
||||
}
|
||||
|
||||
else if (hash === '#/estimation')
|
||||
{
|
||||
currentComponent = component(EstimationChances)(app)
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
currentComponent = component(App)(app)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', navigate)
|
||||
|
||||
Reference in New Issue
Block a user