Answer the question
In order to leave comments, you need to log in
How to make an object see new v-on event handlers in Vue?
I create an org object that has an orgajax method - it pulls data from the server, including HTML code that contains buttons with a link to the same method, like v-on:click="orgajax(''select, 19) ". Since our object has already been created, it does not see these directives, how to make them see? I understand that I need to somehow update the object and created a second then in orgajax. Tell me what to push there or how to update the object in another way?
var org = new Vue({
el: '#orgForm',
data: {
Feed: '',
Current: {
}
},
methods: {
orgajax: function(mode, id) {
alert('!!!!');
axios
.post('/api/?version=3', {task: 'vue-salary-org', mode: mode, id: id, data: this.Current})
.then(response => {
this.Feed = response.data.html;
this.Current = response.data.current;
//$('#orgModal').modal('show');
})
.then(function () {
})
.catch(function (error) {
console.log(error);
});
}
},
created: function () {
this.orgajax();
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question