added routing example
This commit is contained in:
parent
7ea3b9aee9
commit
fd8d03fc11
|
@ -3,3 +3,5 @@ body {font-size: 1.2em;}
|
|||
.header, .footer {
|
||||
margin: 1.4em 0;
|
||||
}
|
||||
|
||||
code {color: indianred}
|
||||
|
|
|
@ -43,6 +43,11 @@ route('/', function () {
|
|||
riot.mount('#view', 'home');
|
||||
});
|
||||
|
||||
// about page
|
||||
route('/about', function () {
|
||||
riot.mount('#view', 'about');
|
||||
});
|
||||
|
||||
// [ start router ] ------------------------------
|
||||
|
||||
route.start(true);
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Footer>
|
||||
<section class="footer">
|
||||
©2018 Your Website |
|
||||
©2019 Your Website |
|
||||
All rights reserved. |
|
||||
<a href="http://riotjs.com">RiotJS</a>
|
||||
<a href="http://n2geoff.github.io/grayscale/">Grayscale CSS</a>
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue