I have structure like in sample below
new Vue({
el: '#app',
data: {
tasks: ['task1', 'task2', 'task3'],
actions: {
'task1': {
name: 'dig',
time: '20min'
},
'task2': {
name: 'run',
time: '1h'
},
'task3': {
name: 'drinking',
time: 'all night'
}
}
},
template: `
<ul>
<li v-for="task in tasks">
{{ actions[task].name }} will take {{ actions[task].time }}
</li>
</ul>
`
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.0/vue.js"></script>
<div id='app'></div>
and I would like to move actions[task]
to some local variable witch will be visible only in loop. I try to move it to data
object bu when there are more objects in arrays Vue throw You may have an infinite update loop
error
[ EDIT ]
Below original part of template
<tr v-for="issue in issues" :key="issue.id">
<td>
<div>{{ issue.jiraKey }}</div>
<div class="issue-description">
[ {{ issue.summary }} ]
</div>
</td>
<template v-for="variant in variants">
<td v-for="browser in issue.devices[variant.key].browsers">
<!--
logic with `browser` and `issue.devices[variant.key]`
-->
</td>
</template>
</tr>