我传递一个道具给我的意见,但是当我在控制台打印结果它发送给我未定义,但在视图中打印我的ID,因为未定义我不能做请求/咨询型这是代码:组件道具未定义在Vue.js
export default {
props: ['idVideo'],
data:() => ({
videos: []
}),
created() {
//do something after creating vue instance
this.api = new ApiCanal10({})
this.getRelVideos()
},
methods: {
getRelVideos: function() {
//print in the console
console.log(`video/related/${this.idVideo}`)
}
}
}
我会很感激,如果你能帮助我这个问题。
打印前您有错误异常。你确定它与此无关吗? – LiranC
这是一个本地播放器的警告,但它是一个不同的组件,它不会影响自己的项目 –