1.当页面@click点击事件无效时,给页面的vue命一个名,通过具体名字下面的方法调用,具体使用如下
<div :data="index" onclick="headerVue.showDialog(this)" ></div>
<script>
const headerVue = new Vue({
el: "#app",
name:"main",
data() {
return {
smsNoticeList: [],
isShow: false,
form: {},
}
},
methods: {
showDialog(that) {
let need = $(that).attr("data")
console.log(this)
this.isShow=true
this.form=this.smsNoticeList[need]
console.log(this.form)
},})