I have an array with objects. The information of each object will be show in a individual v-card for each object. In each v-card there is a v-btn with a v-dialog that show information of the same object that it belongs, (here is my trouble). When i click any v-btn does not show it's infromation on the v-dialog, does show the other's objects information.
Hope any can help, i have tried different ways wit out success. Here is my code:
<template>
<v-layout justify-center align-center wrap>
<v-flex xs12 sm6>
<v-card v-for="(item, index) in ordenes" :key="index">
<v-card>
{{ item.date }} <!-- works ok -->
<template>
<v-dialog v-model="dialog" persistent max-width="290">
<template v-slot:activator="{ on }">
<v-btn v-on="on" class="caption" small>Form info</v-btn>
</template>
<v-card>
<tr>{{ montoTot(item) }}</tr> <!-- here is the problem, in each click show different data-->
</v-card>
</v-dialog>
</template>
</v-card>
</v-card>
</v-flex>
</v-layout>
</template>
the script:
export default {
data () {
return {
dialog: false,
ordenes: [{ date: 1, price: 1},
{ date: 2, price: 2},
],
}
},
methods: {
montoTot (item) {
var mT = 10 + item.price
return mT
},
}