在画布处添加点击事件
<div id="icanvas" style="list-style:none;background:white;width:100px" v-html="D_program" @click="getDivE" >{{D_program}}</div>
点击事件如下
getDivE(event){
console.log(event.target)
console.log(event.target.src)
this.netImg = event.target.src
console.log($(event.target).parent().parent().data("id"))
this.imgfatId = $(event.target).parent().parent().data("id")
// var imgFendId = $(event.target).parent().parent().data("id")
// console.log(imgFendId+'')
$('.active:not(li)').removeClass('active')
$(event.target).addClass('active')
},
替换事件
var _this = this
// console.log(event)
console.log(event.FilePath)
_this.netImg = event.FilePath
var uesImgList = _this.userSrcimg
var FaimgID = _this.imgfatId
this.netImg = event.FilePath;
console.log( $(".active:not(li)"))
$(".active:not(li)").attr('src',event.FilePath)