html
<img @touchstart="start" class="ppimg" :src="imgUrl" alt="">
js(methods)
start() {
var that = this;
this.longClick = 0;
this.timeOutEvent = setTimeout(function() {
that.longClick = 1;
that.downImg()
}, 500);
},
downImg(){
if(!window.plus) return;
plus.gallery.save(this.imgUrl, function () {
alert('保存成功!');
},function(){
alert('保存失败,请重试!');
});
},
js(data)
data() {
return {
imgUrl: "",
longClick: 0,
timeOutEvent: 0
};
},