Using a Backbone listener with a Vue component

281 Views Asked by At

Not particularly an expert with front end so seeking some help, apologies if this has been answered.

I have a backbone listener that is set to run some function when the "data" event occurs:

myResults.on("data", function() { ... });

is it possible to somehow get and output of the data from within the function to go into a Vue component so it can later be rendered by Vue? Or is there a way to make a Vue listener that can listen to the Backbone listener?

Thank you in advance.

1

There are 1 best solutions below

0
T J On

Not very familiar with vue syntax, but you could try passing an object reference view props, something like:

const data = {
  title: ''
}

<blog-post title={data.title}></blog-post>

myResults.on("data", function() { data.title = "Something new" });