这是主要的vue组件。我想发一个ajax请求,并使用render方法将数据传递给我的app组件,这是一个不同文件中的独立组件。如何传递此数据以及如何在我的应用程序组件中检索它。我正在学习Vue,我知道如何用<template></template>
做这个,但想知道是否可以这样做。
new Vue({
el: '#app',
data: {
data: {}
},
mounted() {
axios.get("http://stag.cyberserge.com:4000/autos").then(res => this.data = res.data)
},
render: h => h(App, this.data)
});