createApp({
setup() {
let price = 0
onMounted() {
// axios
price = axios.response
}
return { price }
}
}).mount('#app')
HTML
<h6 id="app" class="mb-0">{{price}}</h6>
Currently, there is a continuous output of 0 as the value. Upon examination, it appears that the setup function is returning before the onMounted function, causing the rendering to occur. Need guidance on how to address this issue.
Any suggestions?