- Fetch Error: TypeError: Cannot
- react-native 运行时候出现的BUG
- Error in v-on handler: "TypeErro
- Error in nextTick: "TypeError: C
- Vue Syntax Error: TypeError: Can
- Cannot fetch...not a valid SHA1
- Error in nextTick: "TypeError: C
- [Vue warn]:Error in nextTick:"Ty
- vue 报错 :Error in render: "TypeEr
- vue 踩坑 Error in nextTick: "TypeE
Fetch Error: TypeError: Cannot set property 'info' of undefined
at eval (VM532 HelloWorld.vue:134)
fetch('https://api.coindesk.com/v1/bpi/currentprice.json')
.then(function(response) {
return response.json();
})
.then(function(data) {
console.log('data', data);
this.info=data;
})
.then((data)=>{
this.info=data;
})
.catch(function(error) {
console.log('Fetch Error: ', error);
});
function(data){ } 与(data)=>{} 作用域不一样 ,所以要this.info绑定数据(data)=>{} 写法
网友评论