Last active
July 26, 2018 10:18
-
-
Save nolimits4web/343cd554e8ca1c575ea4cc64739800e2 to your computer and use it in GitHub Desktop.
Framework7 router component template literal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- new "es" attribute to treat it as template literal --> | |
<template es> | |
<div class="page"> | |
<div class="navbar"> | |
<div class="navbar-inner"> | |
<div class="title">Profile</div> | |
</div> | |
</div> | |
<div class="page-content"> | |
<!-- use conditional (ternary) operator instead of if/else --> | |
${this.user ? ` | |
<!-- Show user list when it is loaded --> | |
<div class="list simple-list"> | |
<ul> | |
<li>First Name: ${this.user.firstName}</li> | |
<li>Last Name: ${this.user.lastName}</li> | |
<li>Age: ${this.user.age}</li> | |
</ul> | |
</div> | |
` : ` | |
<!-- Otherwise show preloader --> | |
<div class="block block-strong text-align-center"> | |
<div class="preloader"></div> | |
</div> | |
` | |
} | |
</div> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment