I' using async function like this:
methods:{
async getUser(id)
{
const header = '........';
let responses=await axios.get(`/api/backend/method/${id}` , {headers: header});
return responses.data.name;
},
calling it on load of td in a loop, like this
<td v-html="getUser(request.id)"></td>
now in my td i get [object Promise] but in this variable responses.data.name there is name, i want to return that name. Any help is highly appreciated.
getUserwithawait, so the returned value is its Promise.data, then invoke the method inside some lifecycle hook, finally the template simply reads fromdata- or just use vuex (with moduleinit)