📜  vuejs 我的图表在获取数据之前加载 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:11.792000             🧑  作者: Mango

代码示例1
Your issue is that API requests are async. So it happens that your chart will be rendered, before your API request finishes. A common pattern is to use a loading state and v-if.

There is an example in the docs: https://vue-chartjs.org/guide/#chart-with-api-data