组件中html中的this还存在吗
今天找到了方法,通过$event.target可以访问当前文档
@click = "choseNote($event)
choseNote : function(event){
console.log(event.target)
}
最后打印出来了当前p标签
非常感谢各位给我的解答,给了我很多启发。
在html中调用函数,并传值this
@click = “show(this)”
函数
show(index){
console.log(index)
}
结果为null
组件中调用函数时怎样传值表示当前文档呀?