<div @click=”router(items.productId)” style=”float: left;” :key=’items.productName’ v-for=”items in item”> </div>
获取:
router(e){
conslone.log(e);
}
补充:Vue.js的事件 (单双击、鼠标和键盘)以及阻止事件冒泡
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ Demo ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
HTML :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"></meta>
<title>VueDemo</title>
<link rel="stylesheet" href="style.css" rel="external nofollow" ></head>
<script