提交 c37af7e5 编写于 作者: D DCloud_LXH

fix: scroll-view e2e error

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