[Vuejs]-Vue.js automatically restore after data changes

0👍

Because you don’t change the data value. As src is bound to postForm.avatar, you shoud be changing this data instead of modifying DOM directly:

this.postForm.avatar = $api.dom("#avatar")

instead of

$api.attr($api.dom("#avatar"), 'src', val);

Leave a comment