From 5768cca2ff291aaf8e3f814f639899c2a840ddda Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Mon, 4 Mar 2024 18:21:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20CN-1572=20=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E5=91=BD=E5=90=8D=E4=BF=AE=E6=94=B9=E4=B8=BAlocation?= =?UTF-8?q?=E5=BC=80=E5=A4=B4=E7=9A=84=EF=BC=9B=E5=AE=9E=E7=8E=B0=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8Header=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E7=9A=84=E5=8F=96=E6=B6=88=E5=85=B3=E6=B3=A8=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=EF=BC=9B=E8=A7=A3=E5=86=B3=E9=97=AE=E9=A2=98=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=9F=A5=E8=AF=A2=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E5=88=B0=E5=BA=95=E9=83=A8=EF=BC=8C=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tools.js | 6 +- src/views/location/Index.vue | 133 ++++++++++++++++++++++++++--------- 2 files changed, 104 insertions(+), 35 deletions(-) diff --git a/src/utils/tools.js b/src/utils/tools.js index 3d758756..b0e78efb 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -300,7 +300,7 @@ export const selectLoadMore = { const selectDom = document.querySelector('.search-select .el-select-dropdown__wrap') function loadMores() { //判断是否到底 - const isBase = this.scrollHeight - this.scrollTop <= this.clientHeight + const isBase = this.scrollHeight - this.scrollTop <= this.clientHeight + 10 if(isBase) { binding.value && binding.value() } @@ -309,7 +309,9 @@ export const selectLoadMore = { el.selectDomInfo = selectDom el.selectLoadMore = loadMores //监听滚动事件 - selectDom.addEventListener('scroll',loadMores.bind(selectDom)) + if(selectDom) { + selectDom.addEventListener('scroll',loadMores.bind(selectDom)) + } }, unmounted (el, binding) { // 解除事件监听 diff --git a/src/views/location/Index.vue b/src/views/location/Index.vue index b0e4c364..16ccb60c 100644 --- a/src/views/location/Index.vue +++ b/src/views/location/Index.vue @@ -39,8 +39,6 @@ -