Why does not the code Vue.js?

function click() {
 var id = this.id; // stores the ID of the polygon to a variable

 $.get("/addmap", { map: id })
 .done(function(data) {

 var app1 = new Vue({
 el:"#"+ str(data),
data:{
 active: {
 activem: false
}
}
});

});

 var app2 = new Vue({
 el:"#" + id,
data:{
 active: {
 activem: true
}
}
});
 }


The point is that a click occurs get request returns the Id of the element, and here it is necessary to remove the class, and another item to add. So this code only adds and absolutely refuses to clean up the class
June 8th 19 at 17:27
0 answer

Find more questions by tags JavaScriptjQueryVue.js