I need to check the rasters_previews_list variable for a change. Here is my code:
var userContent = Vue.extend({ template: '<p>Some template</p>', data: function () { return { rasters_previews_list: [] } }, watch: { 'rasters_previews_list': function(value, mutation) { console.log("Value changed"); } } });
But in the console, I do not see Value changed when it received new data.
Data Change Function:
map.on('draw:created', function (e) { //... Vue.http.post('/dbdata', DataBody).then((response) => { userContent.rasters_previews_list = response; // putting JSON answer to Component data in userContent console.log(response); }, (response) => { console.log("Can't get list rasters metadata from DB. Server error: ", response.status) });
I am changing the value in map.on('draw:created', function (e) (JS flyer). I can see the output of console.log, so the data seems to change.
source share