Skip to content

Instantly share code, notes, and snippets.

@Rebolon
Created November 5, 2016 20:50
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Rebolon/ef5566303c9200228c1301243f37331e to your computer and use it in GitHub Desktop.
Save Rebolon/ef5566303c9200228c1301243f37331e to your computer and use it in GitHub Desktop.
A solution to use debugger in v-for for VueJS
<ul id="pages-block">
<li v-for="page in pages">
<a v-bind:href="page.url">{{page.name}}</a>
<debug :item="page"/>
</li>
</ul>
...
Vue.component('debug', {
template: "<!-- debug -->",
props: [
"item"
],
created: function() {
console.log("debug", this.item.name);
debugger
}
});
@raultm
Copy link

raultm commented May 22, 2018

Starting with vue, gist 2 yo and... it works like a charm! Thanks for share

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