提交 c37af7e5 编写于 作者: D DCloud_LXH

fix: scroll-view e2e error

上级 cae888e8
......@@ -121,26 +121,26 @@ export default /*#__PURE__*/ defineBuiltInComponent({
content
)
const mainStyle = computed(() => {
let style = ''
props.scrollX
? (style += 'overflow-x:auto;')
: (style += 'overflow-x:hidden;')
props.scrollY
? (style += 'overflow-y:auto;')
: (style += 'overflow-y:hidden;')
return style
})
return () => {
const {
scrollX,
refresherEnabled,
refresherBackground,
refresherDefaultStyle,
} = props
const { refresherEnabled, refresherBackground, refresherDefaultStyle } =
props
const { refresherHeight, refreshState, refreshRotate } = state
return (
<uni-scroll-view ref={rootRef}>
<div ref={wrap} class="uni-scroll-view">
<div
ref={main}
style={{
overflowX: scrollX ? 'auto' : 'hidden',
overflowY: scrollY ? 'auto' : 'hidden',
}}
class="uni-scroll-view"
>
<div ref={main} style={mainStyle.value} class="uni-scroll-view">
<div ref={content} class="uni-scroll-view-content">
{refresherEnabled ? (
<div
......
......@@ -5818,9 +5818,14 @@ var index$h = /* @__PURE__ */ defineBuiltInComponent({
scrollLeftNumber
} = useScrollViewState(props2);
useScrollViewLoader(props2, state, scrollTopNumber, scrollLeftNumber, trigger, rootRef, main, content);
const mainStyle = vue.computed(() => {
let style = "";
props2.scrollX ? style += "overflow-x:auto;" : style += "overflow-x:hidden;";
props2.scrollY ? style += "overflow-y:auto;" : style += "overflow-y:hidden;";
return style;
});
return () => {
const {
scrollX,
refresherEnabled,
refresherBackground,
refresherDefaultStyle
......@@ -5837,10 +5842,7 @@ var index$h = /* @__PURE__ */ defineBuiltInComponent({
"class": "uni-scroll-view"
}, [vue.createVNode("div", {
"ref": main,
"style": {
overflowX: scrollX ? "auto" : "hidden",
overflowY: scrollY ? "auto" : "hidden"
},
"style": mainStyle.value,
"class": "uni-scroll-view"
}, [vue.createVNode("div", {
"ref": content,
......
......@@ -606,8 +606,8 @@ function createScrollListener({
const isReachBottom = () => {
const {scrollHeight} = document.documentElement;
const windowHeight = window.innerHeight;
const scrollY2 = window.scrollY;
const isBottom = scrollY2 > 0 && scrollHeight > windowHeight && scrollY2 + windowHeight + onReachBottomDistance >= scrollHeight;
const scrollY = window.scrollY;
const isBottom = scrollY > 0 && scrollHeight > windowHeight && scrollY + windowHeight + onReachBottomDistance >= scrollHeight;
const heightChanged = Math.abs(scrollHeight - lastScrollHeight) > onReachBottomDistance;
if (isBottom && (!hasReachBottom || heightChanged)) {
lastScrollHeight = scrollHeight;
......@@ -7934,9 +7934,14 @@ var ScrollView = /* @__PURE__ */ defineBuiltInComponent({
scrollLeftNumber
} = useScrollViewState(props2);
useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber, trigger, rootRef, main, content);
const mainStyle = computed(() => {
let style = "";
props2.scrollX ? style += "overflow-x:auto;" : style += "overflow-x:hidden;";
props2.scrollY ? style += "overflow-y:auto;" : style += "overflow-y:hidden;";
return style;
});
return () => {
const {
scrollX,
refresherEnabled,
refresherBackground,
refresherDefaultStyle
......@@ -7953,10 +7958,7 @@ var ScrollView = /* @__PURE__ */ defineBuiltInComponent({
"class": "uni-scroll-view"
}, [createVNode("div", {
"ref": main,
"style": {
overflowX: scrollX ? "auto" : "hidden",
overflowY: scrollY ? "auto" : "hidden"
},
"style": mainStyle.value,
"class": "uni-scroll-view"
}, [createVNode("div", {
"ref": content,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册