uniapp瀑布流组件

组件components>waterfallFlow>waterfallFlow

<template>
	<view>
		<view class="flow-box" :style="'height: ' + loadingTop + 'rpx'" ref="flow_box">
			<!-- <empty v-if="newList.length === 0"></empty> -->
			<empty v-show="isShowEmpty"></empty>
			<view v-for="(item, index) in newList" :key="item.ProductId" class="item good_item"
				v-show="positionList[item.ProductId].imageLoad"
				:class="positionList[item.ProductId].right ? 'right' : 'left'"
				:style="{top: positionList[item.ProductId].top + 'rpx'}" @click="onPageJump(item.ProductId)">
				<view class="goods_img">
					<image :data-id="item.ProductId" @load="onImageLoad" :src="item.MainImageUrl_Real" mode="widthFix"  @error="imgerror($event, index)">
					</image>
				</view>
				<view class="title">{
  { item.ProductName }}</view>
				<!-- <view class="goods_cont">{
  {item.Desc}}</view> -->
				<!-- <view class="club" v-if="item.type">
					<text class="goods_money_old">原价 ¥{
  {item.MinPrice}} </text>
					<view class="goods_money members">
						<text class="members_bg">VIP</text> ¥ {
  {item.MemberPrice}}
					</view>
				</view>
				<view v-else class="goods_money">原价¥ {
  {item.MinPrice}}</view> -->
				<view class="club">
					<text class="goods_money_old">原价¥{
  {item.MinPrice}} </text>
					<view class="goods_money members">
						<text class="members_bg">高级会员</text> ¥{
  {item.MemberPrice}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	const defaultData = {
		// 起始距离(rpx)
		startTop: 0,
		// 除了图片和标题以外的高度(rpx)
		// contentHeight: 20 + 22 + 20 + 20 + 20 + 10,
		contentHeight: 112,
		// 瀑布流容器宽度(rpx)
		viewWidth: 350,
		// 标题可显示宽度(rpx)
		titleWidth: 300,
		// 标题文字大小(rpx)
		titleSize: 28,
		// 容器之间的间隔Y轴(rpx)
		viewSpace: 16,
		// 列表ID参数名称
	
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
关于uniapp瀑布流组件的使用,根据引用内容,可以了解到以下几点: 1. 父组件中的下拉刷新函数(onPullDownRefresh)可以通过调用this.$refs.myWaterfallFlow.clear()方法来清空瀑布流组件中的列表数据。这个方法在列表被置为空时是必须调用的。如果场景是强制渲染,可以使用this.$refs.myWaterfallFlow.update()方法进行更新,例如排序操作。提供了一个瀑布流组件的代码示例,并且在仓库中有两种实现方式。你可以通过访问仓库来查看详细代码。 3. 引用中提到,在父组件中将list数据写死在data中是不会渲染瀑布流组件的。因为组件内部是通过watch监听list的更新来进行渲染的。所以需要确保list数据在父组件中有更新才能正常渲染瀑布流列表。 综上所述,在uniapp中使用瀑布流组件时,需要注意在下拉刷新等场景下使用this.$refs.myWaterfallFlow.clear()方法清空列表数据,同时确保list数据在父组件中有更新才能正常渲染瀑布流列表。你可以参考仓库中提供的代码示例来进行具体实现。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [手把手写一个uniapp小程序瀑布流组件](https://blog.csdn.net/searchtext/article/details/124986209)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值