Last active
July 26, 2018 10:14
-
-
Save nolimits4web/b068ca23077bfa821d9ca850e60babfb to your computer and use it in GitHub Desktop.
Framework7 router component template literal
This file contains hidden or 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
<template es> | |
... | |
${this.users.map((user, index) => ` | |
<div class="list simple-list" data-index="${index}" data-id="${user.id}"> | |
<ul> | |
<li>First Name: ${user.firstName}</li> | |
<li>Last Name: ${user.lastName}</li> | |
<li>Age: ${user.age}</li> | |
</ul> | |
</div> | |
`).join('')} | |
... | |
</template> | |
<script> | |
return { | |
data() { | |
return { | |
users: [ | |
{ | |
id: 1, | |
firstName: 'John', | |
lastName: 'Doe', | |
age: 32, | |
}, | |
{ | |
id: 2, | |
firstName: 'Jane', | |
lastName: 'Smith', | |
age: 23, | |
}, | |
] | |
}; | |
}, | |
// ... | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment