uni-app开发微信小程序,页面上需要通过一个按钮点击弹出picker-view筛选城市,simple-address是自定义城市筛选组件(类mpvue-picker),当数据为空时,组件弹出很流畅,但是当页面有数据时(数据不多,就5条),点击按钮后,要1-2s后才弹出。merchant-item
是自定义列表item组件。
<template>
<view class="merchant-list" v-if="hasLocation != null">
<view class="sticky-wraper">
<uni-search-bar class="search-bar" :cancelButton="false" @confirm="handleSearch" :radius="5" clearButton="none" placeholder="请输入店铺名"></uni-search-bar>
<view class="condition-wraper">
<view class="condition" @click="openAddress">{{locationName}}<text class="iconfont icon-arrowdown"></text></view>
<view class="condition sort">按距离排序</view>
</view>
</view>
<view class="items-container">
<template v-if="items.length > 0">
<merchant-item v-for="(item, idx) in items" :key="item.id" :item="item" />
</template>
<empty v-else primaryColor="#fff" />
</view>
<simple-address ref="simpleAddress" cancelColor="#3f3f3f" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor="#bd9250"></simple-address>
</view>
</template>
openAddress() {
this.$refs.simpleAddress.open();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…