render: (h) => {
const self = this;
cosole.log(self)// undefined
}
//"vue": "^2.6.10",
render(h){
cosole.log(this)
打印之后 给了一个Proxy。为什么?
}
render: (h) => {
const self = this;
cosole.log(self)// undefined
}
//"vue": "^2.6.10",
render(h){
cosole.log(this)
打印之后 给了一个Proxy。为什么?
}
9 回答1.7k 阅读✓ 已解决
6 回答1.5k 阅读
3 回答1.4k 阅读✓ 已解决
4 回答1.2k 阅读✓ 已解决
2 回答1.2k 阅读✓ 已解决
3 回答1k 阅读
3 回答1.3k 阅读✓ 已解决
不要写箭头函数,箭头函数没有this,他里面的this你可以看做一个变量,这样就找到上层作用域了