Skip to content

Instantly share code, notes, and snippets.

@nolimits4web
Last active July 26, 2018 10:14
Show Gist options
  • Save nolimits4web/b068ca23077bfa821d9ca850e60babfb to your computer and use it in GitHub Desktop.
Save nolimits4web/b068ca23077bfa821d9ca850e60babfb to your computer and use it in GitHub Desktop.
Framework7 router component template literal
<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