Browse Source

fix: 🧩 热门搜索没有时不展示

pull/5/head
liyongle 3 years ago
parent
commit
dca9a18a94
  1. 4
      src/components/Search/Hot.vue

4
src/components/Search/Hot.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="hot-container">
<div v-if="list.length" class="hot-container">
<div class="title">{{ $t('hot') }}</div> <div class="title">{{ $t('hot') }}</div>
<ScrollView class="myScoll" :list="list" :pull-up="false"> <ScrollView class="myScoll" :list="list" :pull-up="false">
<div class="shop_list"> <div class="shop_list">
@ -26,7 +26,7 @@ import { getIndexJson } from '@/http/api/base'
import { useRootStore } from '@/store/root' import { useRootStore } from '@/store/root'
import { useStatistics } from '@/composables/useStatistics' import { useStatistics } from '@/composables/useStatistics'
import ScrollView from '@/base/ScrollView/ScrollView.vue' import ScrollView from '@/base/ScrollView/ScrollView.vue'
const list = ref<HotSearch[]>()
const list = ref<HotSearch[]>([])
getIndexJson().then(({ data }) => { getIndexJson().then(({ data }) => {
list.value = data.hotSearch list.value = data.hotSearch
}) })

Loading…
Cancel
Save