added routing example

This commit is contained in:
Geoff Doty 2019-06-19 17:45:10 -04:00
parent 7ea3b9aee9
commit fd8d03fc11
5 changed files with 52 additions and 44 deletions

View File

@ -3,3 +3,5 @@ body {font-size: 1.2em;}
.header, .footer {
margin: 1.4em 0;
}
code {color: indianred}

View File

@ -43,6 +43,11 @@ route('/', function () {
riot.mount('#view', 'home');
});
// about page
route('/about', function () {
riot.mount('#view', 'about');
});
// [ start router ] ------------------------------
route.start(true);

View File

@ -1,11 +1,11 @@
<Home>
<section class="is-clear">
<section class="">
<h1>RiotJS Kickstarter</h1>
Built your next revolutionary <em>Single Page Application</em> (SPA) starting right here:
<blockquote>/app/tags/home.tag.html</blockquote>
<blockquote><code>/app/tags/home.tag.html</code> </blockquote>
This <strong>seed</strong> kicks your development into high gear with all tools you'll <em>need</em>, and very <em>little</em> you don't.

View File

@ -1,6 +1,6 @@
<Footer>
<section class="footer">
&copy;2018 Your Website |
&copy;2019 Your Website |
All rights reserved. |
<a href="http://riotjs.com">RiotJS</a> &nbsp;
<a href="http://n2geoff.github.io/grayscale/">Grayscale CSS</a>

View File

@ -1,13 +1,14 @@
<Header>
<section class="header">
<ul class="navbar">
<li class="nav is-large">RiotJS</li>
<li class="nav"><a href="#/">Home</a></li>
</ul>
<section class="nav">
<div class="nav-section">
<div class="is-large">RiotJS</div>
<div class="content"><a href="#/">Home</a></div>
<div class=""><a href="#/about">About</a></div>
</div>
</section>
<style>
/* scoped styles */
.header {border-bottom: 1px solid #222;}
.nav {border-bottom: 1px solid #222;}
</style>
</Header>