Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Passing Vue data into Ejs include()

Look please

<div v-for="food in foods">
        <%- include('../partials/navbar', {food:food}); %>
</div>

Here I’m trying to pass food from foods array using Vue into Ejs include() function. Does anybody know how to make it work?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Use component instead:

<navbar v-bind='food' />

More about props:
https://ru.vuejs.org/v2/guide/components-props.html
More about components
https://ru.vuejs.org/v2/guide/components-registration.html

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading