Skip to content
Advertisement

Vue – Passing prop array through vue component causes not defined error

I’m trying to pass an array of dates through to my component, but it keeps throwing

JavaScript

I don’t understand why, as I’m receiving the variable in props, I’m using laravel btw. I can use props like this if I reference them in the vue instance on a my app.js file, but I cant get my php variables into that file so there’s no point .

Base:

HTML:

JavaScript

JS:

JavaScript

Component:

Template:

JavaScript

JS:

JavaScript

Vue instance startup:

JavaScript

Any help would be amazing! Thankyou 🙂

Advertisement

Answer

Try this: rather than creating a variable for your dates, go to the place where you do this:

JavaScript

And replace :dates="dates" with this:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement