city-casereport/components/coolui-scroller/item/index.js
2023-12-06 14:22:42 +08:00

34 lines
619 B
JavaScript

Component({
relations: {
"../scroller/index": {
type: "parent",
linked() {},
},
},
properties: {
ripple: {
type: Boolean,
value: false
},
},
data: {
rippleStyle: "",
},
methods: {
itemTap(e) {
if (this.data.ripple) {
var x = e.changedTouches[0].pageX;
var y = e.currentTarget.offsetTop;
this.setData({
rippleStyle: "left:" + x + "px;animation: ripple 0.5s linear;",
});
setTimeout((res) => {
this.setData({
rippleStyle: "",
});
}, 500);
}
},
},
});