I'm trying to define dynamic variables for VUE, and then use them inv-for. when I load the page they work, but if they change their values later, the values in the view do not change anymore.
VUE
const app = new Vue({
el: '#mainCreate',
data: {
modules : [],
feature: []
},
});
I am using this function to generate the variables within feature:
function creatDataFeatures() {
$.each(app.modules, function(index,module){
app.feature[index] = module.features;
});
}
So I'm loading it in the view:
<table class="table table-striped mt-3">
<tbody>
<tr v-for="feat in feature[index]">
<td>
<input type="checkbox" checked>
</td>
<td>
@{{feat.title}}
</td>
<td class="text-info">
@{{feat.price ? '$ '+feat.price : '$ 0'}}
</td>
</tr>
</tbody>
</table>
When loading the page I load the data correctly, but if I then change the ejm values: feature [index] = [other array] (I change it for the same data format as the start ones) in the view does not change anything. a solution or an alternative would be great.