【发布时间】:2017-11-09 15:30:04
【问题描述】:
这是主要的 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)
});
【问题讨论】:
标签: javascript vue.js vuejs2 vue-component