SPB Git

Repository Public

spa.html 637 B 14 lines html

1<!doctype html>2<html><head><meta charset="utf-8"><title>SPA</title></head>3<body><div id="app"></div>4<script>5const app = document.getElementById('app');6function renderRoute(path) {7  app.innerHTML = '<h1>SPA-VIEW ' + path + '</h1><nav><span data-route="/p/spa/about">About</span> ' +8    '<span routerlink="/p/spa/products/42">Product</span> <a href="#/settings">Settings</a> <a href="/p/spa/real-link">Real</a></nav>';9}10history.replaceState({}, '', '/p/spa/home');11renderRoute('/p/spa/home');12setTimeout(() => { history.pushState({}, '', '/p/spa/dashboard?tab=1'); renderRoute('/p/spa/dashboard'); }, 100);13</script></body></html>14
Files main
Menu

Theme