在vue中使用ref,ref绑定在文档元素上面,如
<input type="text" ref="io"/>
获取:
this.$refs.io
设置$event
<button @click="ok($event)"></button>
使用$event
methods:{
ok(e){
console.log(e)
}
}
在vue中使用ref,ref绑定在文档元素上面,如
<input type="text" ref="io"/>
获取:
this.$refs.io
设置$event
<button @click="ok($event)"></button>
使用$event
methods:{
ok(e){
console.log(e)
}
}