Created
November 5, 2016 20:50
-
-
Save Rebolon/ef5566303c9200228c1301243f37331e to your computer and use it in GitHub Desktop.
A solution to use debugger in v-for for VueJS
This file contains hidden or 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
<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 | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Starting with vue, gist 2 yo and... it works like a charm! Thanks for share