Skip to content

Instantly share code, notes, and snippets.

@mkdizajn
Created November 24, 2017 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkdizajn/d0a761e98b7a0b255b0f75f17925e658 to your computer and use it in GitHub Desktop.
Save mkdizajn/d0a761e98b7a0b255b0f75f17925e658 to your computer and use it in GitHub Desktop.
<div id="list">
<a v-on:click="pullData('posts')">Show posts </a> |
<a v-on:click="pullData('comments')">Show comments </a>
<ul>
<div v-if="type == 'posts' ">
<li v-for="item in items">
<div class="title"> {{ item.title }} </div>
<div class="add1"> {{ item.body }} </div>
</li>
</div>
<div v-else-if="type == 'comments' ">
<li v-for="item in items">
<div class="title"> {{ item.name }} </div>
</li>
</div>
<div v-else></div>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment