[Vuejs]-Vuejs, Get content of a $event.emit

0👍

Try doing it like this:

mounted() {
   var $that = this;

   this.$events.on('emitEvent', function (eventData) {
        $that.line = _.cloneDeep(eventData);
        console.log('1', $that.line);
   })

   console.log('2', this.line);
}

0👍

this should work:

this.$events.on('emitEvent', (eventData) => {
    this.line = _.cloneDeep(eventData)
    console.log('1', this.line)
  })
  console.log('2', this.line)
 }

Leave a comment