Home > other >  Passing Vue data into Ejs include()
Passing Vue data into Ejs include()

Time:05-31

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?

CodePudding user response:

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

  • Related