Last active
March 3, 2016 03:26
-
-
Save mathewsanders/99c8731e81de332e98a1 to your computer and use it in GitHub Desktop.
ContestList.vue template snippet
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
<!-- template code --> | |
<template> | |
<div> | |
<ul> | |
<!-- loop over parties --> | |
<li class="party" v-for="party in APIresponse.parties"> | |
<h3>{{ party.name }} Party</h3> | |
<ol> | |
<!-- loop over contests for a party --> | |
<li class="contest" v-for="contest in party.contests"> | |
<strong>{{ contest.contest_description }}</strong> | |
<ol> | |
<!-- loop over candidates for a contest --> | |
<li class="candidate" v-for="candidacy in contest.candidacies"> | |
{{ candidacy.candidacy_name }} <em>{{ candidacy.group }}</em> | |
</li> | |
</ol> | |
</li> | |
</ol> | |
</li> | |
</ul> | |
<p style="color: blue;">{{ message }}</p> | |
<!-- | |
<p style="font-size:0.5em; color: grey;">{{ APIresponse | json }}</p> | |
<p>{{ contestListInfo | json }}</p> | |
--> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue documentation for how to loop over arrays in template: http://vuejs.org/guide/list.html