triggering computed proper vue code example
Example 1: vue computed
var vm = new Vue({
el: '#example',
data: {
message: 'Hello'
},
computed: {
// a computed getter
reversedMessage: function () {
// `this` points to the vm instance
return this.message.split('').reverse().join('')
}
}
})
Example 2: vue change input value from console
let el = document.getElementById("id");
el.value = val;
el.dispatchEvent(new Event('input'));