Home >Web Front-end >JS Tutorial >How does vue get the currently clicked element and pass the value

How does vue get the currently clicked element and pass the value

小云云
小云云Original
2018-03-12 11:01:006101browse

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=&#39;zan(pl.id)&#39; :data-id=&#39;pl.id&#39;></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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:ajax demo source codeNext article:ajax demo source code