fixes issue where components were being loaded twice

This commit is contained in:
Geoff Doty 2019-06-19 17:44:44 -04:00
parent 556b675cd5
commit 7ea3b9aee9
3 changed files with 38 additions and 6 deletions

View File

@ -28,11 +28,11 @@
<![endif]--> <![endif]-->
<!-- Add your site or application content here --> <!-- Add your site or application content here -->
<div class="layout page"> <div class="layout">
<div class="stack"> <div class="content">
<Header></Header> <Page>
<div id="view"></div> <div id="view"></div>
<Footer></Footer> </Page>
</div> </div>
</div> </div>
@ -41,13 +41,15 @@
<!-- endbuild --> <!-- endbuild -->
<!-- build:js js/tags.min.js --> <!-- build:js js/tags.min.js -->
<script type="riot/tag" src="tags/layout/page.tag.html"></script>
<script type="riot/tag" src="tags/layout/header.tag.html"></script> <script type="riot/tag" src="tags/layout/header.tag.html"></script>
<script type="riot/tag" src="tags/layout/footer.tag.html"></script> <script type="riot/tag" src="tags/layout/footer.tag.html"></script>
<script type="riot/tag" src="tags/home.tag.html"></script> <script type="riot/tag" src="tags/home.tag.html"></script>
<script type="riot/tag" src="tags/about.tag.html"></script>
<!-- endbuild --> <!-- endbuild -->
<!-- mount all included tags --> <!-- mount all included tags -->
<script>riot.mount('*');</script> <script>riot.mount('Page');</script>
<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. --> <!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
<script> <script>

23
app/tags/about.tag.html Normal file
View File

@ -0,0 +1,23 @@
<About>
<section>
<h3>RiotJS</h3>
<blockquote class="block"><code>version: 3.x</code> </blockquote>
</section>
<section>
<h3>Routing</h3>
<p>
By default <code>riot-route</code> is included in this starter kit, but can easily be replaced
with your own solution. This is just an example.
Links are prefiex with a hash <code>#</code>, so the about page becomes
<code>href="#/about"</code>
You can see how that translates in the browser bar of this page
</p>
<blockquote class="blockquote">
Normally, routes are stored in a <code>routes.js</code> file; for simplicity
this example defines them in the <code>app/app.js</code>.
</blockquote>
</section>
</About>

View File

@ -0,0 +1,7 @@
<Page>
<div>
<Header></Header>
<yield />
<Footer></Footer>
</div>
</Page>