一个vue3的接口赋值,不知道哪里错了页面始终不显示,接口没有问题。
应该就是vue3的用法不是很熟写的不好导致的,大家帮我看看
export default defineComponent({
components: {
Chart
},
setup() {
onMounted(() => {
axios.get('/daping/centerRight1')
.then(response => {
config.data=response.data
})
.catch(error => {
console.log(error);
});
})
const config = reactive({
data: []
})
return { config }
}
})