I have an api calling data from db, one of column has Image file name stored. I want to split the file and get the last 3 letters of each filename after the DOT. I am stuck here:
axios.get('/api/v1/chats/messages/' + this.chat).then(response => {
this.result = response.data;
this.details = this.result.data;
for (var j = 0; j < this.details.length; j++) {
this.str = this.details[j].image;
this.details[j].image_type = this.str.split(".");
}
console.log(this.details)
})
.catch(error => {
toastr.error('Something went wrong', 'Error', {
positionClass: 'toast-bottom-right'
});
this.cancelAutoUpdate();
});
Would really appreciate if someone could help me OR please let me know if theres any other way to get the file extension in vue js. Thanks :)