【发布时间】:2019-01-03 01:27:32
【问题描述】:
我有一个 Vue 应用程序,我在其中单独显示事件列表和每个事件,当我访问所选链接的页面时,我的控制台中出现错误提示 GET http://localhost:1337/undefined 404 (Not Found) 然后图像加载
我用这个方法给组件设置了事件的id
export default {
data: function() {
return {
id: this.$route.params.id,
e: {},
users: []
}
},
methods: {
issueTicket: function(id, user) {
}
},
created(){
this.$http.get('http://localhost:1337/api/v1/event/find', { params : { id : this.id } }).then(result => {
this.e = result.body.result[0];
})
}
}
有没有办法摆脱这个错误?我是 Vue JS 的新手
【问题讨论】:
标签: javascript vue.js vuejs2 vue-component vue-router