1.点击事件
2.事件传参
用途:用来点击获取该文章的id--跳转到对应文章的详情页
<template>
<view>
-->
<view :data-id="1"@click="ClickMe">点击我啊</view>
</view>
</template>
//在methods里面定义点击事件的回调
methods: {
ClickMe(e){
console.log('点我点我出来啦');
console.log(e.currentTarget.dataset.id);//获取通过data-index属性来传参id的值
}
}