Answer the question
In order to leave comments, you need to log in
On the [object Promise] page in the console, the value is correct, why and how to fix it?
Hello: I broke my whole head, tell me pliz, I place a button on the page:
<v-btn fab color="#00C3EA" top right absolute class="white--text">
{{ getRating(tutor) }}
</v-btn>
async getRating(tutor) {
let rating=0
let lang = ''
if (!this.language) {
lang = this.$route.query.lang
} else {
lang = this.language
}
const rat = await this.$axios.$post('/tutors/getTutorRating.php', '{"tutor_id": '+tutor.id+', "lang": "'+lang+'"}').then((responce)=>{
rating = responce.average_rating
})
console.log(rating)
return rating
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question