From cbabdca9b803ef2c3d8412ff2c2bdd4a491a5125 Mon Sep 17 00:00:00 2001 From: jacknan Date: Fri, 22 Dec 2023 15:47:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(pull-refresh):=20=E8=B0=83=E6=95=B4foot?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=20(#1181)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(pull-refresh): 调整foot高度 Signed-off-by: jacknan * feat(pull-refresh): 优化无数据初始状态 Signed-off-by: jacknan * fix(pull-refresh): 去除移动端橡皮筋效果 Signed-off-by: jacknan --------- Signed-off-by: jacknan --- packages/renderless/src/pull-refresh/index.ts | 2 ++ packages/renderless/src/pull-refresh/vue.ts | 3 ++- packages/theme-mobile/src/pull-refresh/index.less | 1 + packages/theme-mobile/src/pull-refresh/vars.less | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/renderless/src/pull-refresh/index.ts b/packages/renderless/src/pull-refresh/index.ts index 17739ca1e..ccb1a1161 100644 --- a/packages/renderless/src/pull-refresh/index.ts +++ b/packages/renderless/src/pull-refresh/index.ts @@ -56,6 +56,8 @@ export const pullDownTouchMove = (state, refs, event) => { } if (refs.content.scrollTop <= 0) { + event.preventDefault() + state.translate3d = (event.touches[0].clientY - state.draggposition) / 2 state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText diff --git a/packages/renderless/src/pull-refresh/vue.ts b/packages/renderless/src/pull-refresh/vue.ts index 32d0a5b09..1b57bb2b2 100644 --- a/packages/renderless/src/pull-refresh/vue.ts +++ b/packages/renderless/src/pull-refresh/vue.ts @@ -66,7 +66,8 @@ export const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount if (!value) { state.hasMore = false } - } + }, + { immediate: true } ) watch( diff --git a/packages/theme-mobile/src/pull-refresh/index.less b/packages/theme-mobile/src/pull-refresh/index.less index a400a4766..d30357029 100644 --- a/packages/theme-mobile/src/pull-refresh/index.less +++ b/packages/theme-mobile/src/pull-refresh/index.less @@ -87,6 +87,7 @@ justify-content: center; font-size: var(--ti-mobile-pull-refresh-font-size); color: var(--ti-mobile-pull-refresh-text-color); + height: var(--ti-mobile-pull-refresh-foot-size-height); } @keyframes turn-around { diff --git a/packages/theme-mobile/src/pull-refresh/vars.less b/packages/theme-mobile/src/pull-refresh/vars.less index bf4111eca..23d70502c 100644 --- a/packages/theme-mobile/src/pull-refresh/vars.less +++ b/packages/theme-mobile/src/pull-refresh/vars.less @@ -11,4 +11,6 @@ --ti-mobile-pull-refresh-head-loading-icon-size-inside: 14px; // 加载圆圈背景色 --ti-mobile-pull-refresh-head-loading-icon-bg-color: #fff; + // 组件foot高度 + --ti-mobile-pull-refresh-foot-size-height: 48px; }