Processing data inside watch()

Posted 9 months ago by afoysal

My HTML code is like below

   <li v-for="item in values">{{ item }}</li>

My vue.js code is like below

export default {
        data() {
            return {
                values: []
        props: ['applicants', 'pageinfo'],
        watch: {
            applicants (val) {
                EventBus.$on('click',  function (skillName) {
                    this.values = val[0];   
        console.log(this.values);  // I am getting output here.

I am trying to iterate over the values of val[0]. But I am not getting any output.

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.