提交 532493d4 编写于 作者: shutao-dc's avatar shutao-dc

增加scroll-top检测scroll触发自动检测

上级 64dce247
......@@ -24,6 +24,10 @@ describe('component-native-scroll-view-props', () => {
scrollTop: 600
})
await page.waitFor(600)
//检测滚动top 是否触发scroll 事件
const scrollChangeTop = await page.data('scrollChangeTop')
console.log("scrollChangeTop="+scrollChangeTop)
expect(scrollChangeTop-600).toBeGreaterThanOrEqual(0)
const element = await page.$('#scrollViewY')
const scrollTop = await element.property("scrollTop")
console.log("check_scroll_top---"+scrollTop)
......
......@@ -95,7 +95,8 @@
scrollY: true,
bounces: false,
scrollTop: 0,
scrollLeft: 0,
scrollLeft: 0,
scrollChangeTop: 0,
scrollIntoView: "",
enableBackToTop: false,
scrollWithAnimation: false,
......@@ -171,7 +172,8 @@
scrolltolower() {
console.log("滚动到底部");
},
scroll(e : ScrollEvent) {
scroll(e : ScrollEvent) {
this.scrollChangeTop = e.detail.scrollTop
console.log("scroll-top : " + e.detail.scrollTop + " scroll-left : " + e.detail.scrollLeft);
},
scrollend() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册