Browse Source

fix: 导览页无店铺业态未筛选

v1.0.1
jiannibang 3 years ago
parent
commit
dc745bd0e7
  1. 5
      src/components/BrandScroll/BrandScroll.vue

5
src/components/BrandScroll/BrandScroll.vue

@ -3,7 +3,7 @@
<div class="brand-content" ref="content">
<div
class="groups"
v-for="(item, i) of list"
v-for="(item, i) of filteredList"
:ref="
el => {
groups[i] = el
@ -32,7 +32,7 @@
</div>
</div>
<div class="indicator" :style="{ visibility: hasScollBar ? 'visible' : 'hidden' }" id="indicator" ref="indicatorWrapper">
<div class="handle">{{ list[indicatorIndex]?.name }}</div>
<div class="handle">{{ filteredList[indicatorIndex]?.name }}</div>
</div>
</ScrollView>
</template>
@ -55,6 +55,7 @@ const groups = ref([])
const { height: containerHeight } = useElementSize(scroll)
const { height: contentHeight } = useElementSize(content)
const filteredList = computed(() => props.list.filter(({ shopList }) => shopList.length > 0))
const hasScollBar = computed(() => containerHeight.value < contentHeight.value)
const heights = computed(() => groups.value.map(useElementSize).map(({ height }) => height))
const bounds = computed(() =>

Loading…
Cancel
Save