mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-21 05:55:03 +00:00
Replace ternary assignment with class directive
This commit is contained in:
@@ -50,11 +50,11 @@
|
|||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a class='{segment === undefined ? "selected" : ""}' href='.'>home</a></li>
|
<li><a class:selected='{segment === undefined}' href='.'>home</a></li>
|
||||||
<li><a class='{segment === "about" ? "selected" : ""}' href='about'>about</a></li>
|
<li><a class:selected='{segment === "about"}' href='about'>about</a></li>
|
||||||
|
|
||||||
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
|
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
|
||||||
the blog data when we hover over the link or tap it on a touchscreen -->
|
the blog data when we hover over the link or tap it on a touchscreen -->
|
||||||
<li><a rel=prefetch class='{segment === "blog" ? "selected" : ""}' href='blog'>blog</a></li>
|
<li><a rel=prefetch class:selected='{segment === "blog"}' href='blog'>blog</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Reference in New Issue
Block a user