0👍
✅
Because Vue does not update View right update when data changes so you should submit in nextTick
submitMessage () {
// Submit data to server
return api.createMessage( messageToSend, ( message ) => {
this.latestMessageAttachmentUrl = './messages/' + message.id + '/attachments';
this.$nextTick(() => {
this.$refs.uploadFiles.submit();
})
} );
}
Source:stackexchange.com