You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
992 B
32 lines
992 B
// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 148 2 28 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
|
|
// #ifndef APP-PLUS || MP-WEIXIN || H5
|
|
|
|
export default {
|
|
methods: {
|
|
scrollHandler(event) {
|
|
const detail = event.detail
|
|
const scrollWidth = detail.scrollWidth
|
|
const scrollLeft = detail.scrollLeft
|
|
const width = this.width
|
|
const scrollBarWidth = this.bgWidth
|
|
const blockWidth = this.blockWidth
|
|
const x = scrollLeft / (scrollWidth - width) * (scrollBarWidth - blockWidth)
|
|
this.transform = `translate3d(${x}px,0,0)`
|
|
},
|
|
scrolltoupper(event) {
|
|
this.scrollEvent('left')
|
|
this.transform = 'translate3d(0,0,0)'
|
|
},
|
|
scrolltolower(event) {
|
|
this.scrollEvent('right')
|
|
const x = this.bgWidth - this.blockWidth
|
|
this.transform = `translate3d(${x}px,0,0)`
|
|
}
|
|
}
|
|
}
|
|
|
|
// #endif
|
|
|
|
// #ifdef APP-PLUS|| MP-WEIXIN || H5
|
|
export default {}
|
|
// #endif
|