2๐
<script>
module.exports = {
data: function () {
return {
filedNameFromServer: ['filed1', 'filed2','filed3'],
dataFromServer: {
filed1: 'value1',
filed2: 'value2',
filed3: 'value3'
}
}
},
methods: {
}
}
</script>
HTML:
<template>
<ul>
<li v-for="filedName in filedNameFromServer">
{{ dataFromServer[filedName] }}
</li>
</ul>
//which I want after compile
<ul>
<li>value1</li>
<li>value2</li>
<li>value3</li>
</ul>
</template>
PS: should filed
be field
, or is your data actually about files / filing?
๐คLinus Borg
- [Vuejs]-Vuejs2 dynamic css with dynamic html
- [Vuejs]-Return data object to vue component using laravel 5.6 and axios
Source:stackexchange.com