0👍
You should be more clear when you ask something. Try this
const app = new Vue({
el: '#app',
data() {
return {
options: [
{ id: 1, name: 'Computer' },
{ id: 2, name: 'Books' },
{ id: 3, name: 'System' }
],
access: [
{ name: 'Student', options: [1, 2] },
{ name: 'Teacher', options: [1, 2] },
{ name: 'Security', options: [3] },
],
};
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<table border="1">
<tr>
<td v-for="(access, index) in access" :key="index">{{ access.name }}</td>
</tr>
<tr>
<td v-for="access in access">
<span v-for="option in access.options" :key="access + option">{{ options.find(tempOpt => tempOpt.id === option).name }} </span>
</td>
</tr>
</table>
</div>
- [Vuejs]-Vue js component template not updating with data
- [Vuejs]-How to pass a dynamic value from input field to progress prop of vue-circle component
Source:stackexchange.com