Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 1c7/7267d5789eb9883c7883fc0dfe7b78fd to your computer and use it in GitHub Desktop.
Save 1c7/7267d5789eb9883c7883fc0dfe7b78fd to your computer and use it in GitHub Desktop.
Vue, v-for, display special element in certain position
// This is written in Pug syntax. not HTML. but same thing. Pug would compile to HTML
template(v-for='(l, index) in list')
topic-card(:topic='t', :key='t.id')
template(v-if='index == 2')
// [IMPORTANT: display your specifial element here]
@1c7
Copy link
Author

1c7 commented Sep 4, 2018

The point here is

use v-for + template syntax in Vue.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment