Home  >  Article  >  Web Front-end  >  How to use vue to get the currently clicked element and pass the value (graphic tutorial)

How to use vue to get the currently clicked element and pass the value (graphic tutorial)

亚连
亚连Original
2018-05-31 14:37:442299browse

Below I will share with you an example of vue obtaining the currently clicked element and passing the value. It has a good reference value and I hope it will be helpful to 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
}

The above is I compiled it for everyone, I hope it will be helpful to everyone in the future.

Related articles:

Analysis of javascript prototype and prototype chain

jquery implements dragging file upload loading progress bar function

Detailed explanation of the use of each method in jQuery

The above is the detailed content of How to use vue to get the currently clicked element and pass the value (graphic tutorial). 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