How am I able to send some array data from v-for loop into a prop? So i can read it out inside de template.
Example (index.html):
<grid v-for="boss in bossesArray.slice(0, 20)" test="{{ boss.id }}"></grid>
Where the test="" is the prop inside the template.
Template example (Grid.vue):
<template>
<div class="grid">
<div class="grid__body">
{{ test }}
</div>
</div>
</template>
<script>
export default {
props: ['test'],
data: function () {
return {
msg: "This is a message",
counter: 0
}
}
}
</script>
The result i get back is (Browser):
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
{{ boss.id }}
Is there a way to send the boss id through the prop?