I have the following code and would like to know how I can implement a try / catch with async / await executing the same function:
import Vue from 'vue'
import axios from 'axios'
new Vue({
el: '#app',
data: {
skills: [],
},
mounted() {
axios
.get('http://localhost:8080/wp-json/api/v1/skills')
.then(response => {
this.skills = response
}).catch(err => (console.log(err)))
}
})
Thank you!