Vue,如何在渲染方法中将数据传递给组件

Vue, how do I pass data to component in render method

这是主要的 vue 组件。我想发出 ajax 请求并使用 render 方法将数据传递到我的应用程序组件,它是不同文件中的独立组件。我如何传递这些数据以及如何在我的应用程序组件中检索它。我正在学习 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)
});

将其作为 属性 传递。

render(h){
  return h(App, {props: {appData: this.data}})
},

请参阅文档 here

在您的 App 组件中,将 appData(或您想要的任何名称)添加为 属性。

export default {
    props: ["appData"],
    ...
}

这是一个例子working