Whenerver I'm making an API call, and every time the page loads it comes with this error, somebody please tell me why? I've tried to put it:
mounted () {
this.getStoreScore()
this.fillData()
this.fillData2()
this.fillData3()
this.fillDataScoreLine()
this.fillDataTimeBar()
this.fillDataAnswerPercent()
},
getStoreScore () {
return axios.post('API', {
storeId: '5b7515ed5d53fa0020557447'
}).then(response => {
this.company = {
'storeScore': response.data.result,
'amount': {
'total': response.data.amount.total,
'zero': {
'amount': response.data.amount.zero,
'percentage': response.data.amount.zero / response.data.amount.total * 100
},
'one': {
'amount': response.data.amount.one,
'percentage': response.data.amount.one / response.data.amount.total * 100
},
'two': {
'amount': response.data.amount.two,
'percentage': response.data.amount.two / response.data.amount.total * 100
},
'three': {
'amount': response.data.amount.three,
'percentage': response.data.amount.three / response.data.amount.total * 100
}
}
}
return this.company
})
},
Javascript issue while calling API
Forum rules
This General Discussion board is meant for topics that are still relevant to Pale Moon, web browsers, browser tech, UXP applications, and related, but don't have a more fitting board available.
Please stick to the relevance of this forum here, which focuses on everything around the Pale Moon project and its user community. "Random" subjects don't belong here, and should be posted in the Off-Topic board.
This General Discussion board is meant for topics that are still relevant to Pale Moon, web browsers, browser tech, UXP applications, and related, but don't have a more fitting board available.
Please stick to the relevance of this forum here, which focuses on everything around the Pale Moon project and its user community. "Random" subjects don't belong here, and should be posted in the Off-Topic board.
-
- New to the forum
- Posts: 2
- Joined: 2022-07-27, 11:54
-
- Moon Magic practitioner
- Posts: 2194
- Joined: 2018-05-05, 13:29
Re: Javascript issue while calling API
Which error?
Also this looks like Vue, meaning that the code you posted is not the final code being executed by the browser, so there is no way to tell unless you provide the exact error message.
Also this looks like Vue, meaning that the code you posted is not the final code being executed by the browser, so there is no way to tell unless you provide the exact error message.