This article mainly shares an example of vue getting the currently clicked element and passing the value. It has a good reference value and I hope it can help everyone.
html:
<span @click='zan(pl.id)' :data-id='pl.id'></span>
js:
zan(e){ var target=event.target; var dataid=e;//(pl.id的值); $(target)//当前点击的dom }
Related recommendations:
##JavaScript implements pop-up sub-window and passes value Give parent window_javascript tips
The above is the detailed content of How does vue get the currently clicked element and pass the value. For more information, please follow other related articles on the PHP Chinese website!