mounted() { this.$nextTick(function(){ this.$http.get('http://127.0.0.1:3000/api/articals').then((response) => { console.log(response) this.articals = response.data; },(response) => { // console.log(response) }); }) }, vue的端口是8080,express端口是3000.想在vue-resource中通过/api/articals获取数据。这两个端口应该怎么配置啊?
1 回答
陪伴而非守候
TA贡献1757条经验 获得超8个赞
配置proxyTable
proxyTable: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true
}
}
添加回答
举报
0/150
提交
取消
