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

add sticky-header.test.js

上级 e5db0848
describe('component-native-sticky-header', () => {
let page
beforeAll(async () => {
//打开list-view测试页
page = await program.reLaunch('/pages/component/sticky-header/sticky-header')
await page.waitFor(200)
})
//检测吸顶效果
it('check_sticky_header', async () => {
await page.callMethod('confirm_scroll_top_input', 600)
await page.waitFor(400)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
})
<template>
<list-view :scroll-y="true" class="page" rebound="false" :refresher-enabled="refresher_enabled_boolean"
<list-view :scroll-y="true" class="page" rebound="false" :scroll-top="scroll_top_input" :refresher-enabled="refresher_enabled_boolean"
:refresher-triggered="refresher_triggered_boolean" @refresherrefresh="list_view_refresherrefresh">
<list-item type = 1>
<image src="/static/shuijiao.jpg" style="height: 240px;"></image>
......@@ -28,10 +28,11 @@
export default {
data() {
return {
sift_item: ["最新上架", "免费热榜", "付费热榜", "热门总榜", "观看最多", "平分最高", "下载总榜", "访问排行", "回复总榜"],
sift_item: ["最新上架", "免费热榜", "付费热榜", "热门总榜", "观看最多", "平分最高", "下载总榜", "访问排行", "回复总榜"],
list_item: [] as Array<string>,
refresher_enabled_boolean: true,
refresher_triggered_boolean: false
refresher_triggered_boolean: false,
scroll_top_input: 0
}
},
onLoad() {
......@@ -48,7 +49,10 @@
setTimeout(function(){
this.refresher_triggered_boolean = false
}, 1500)
},
},
confirm_scroll_top_input(value : number) {
this.scroll_top_input = value
}
}
}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册