uni-app使用vantUI的van-swipe-cell滑动单元格

uni-app使用vantUI的van-swipe-cell滑动单元格

<checkbox-group @change="checkboxChange">
	<view v-for="(item,index) in productList" :key="index">
        <!-- 我的项目需求只需要一个左滑右边显示删除键,如果需要右滑左边也显示按钮如下 -->
        <!-- <van-swipe-cell right-width="65" left-width="65"> -->
		<van-swipe-cell right-width="65">
		  	<!-- 如果需要右滑左边也显示按钮如下,左边加一个插槽 -->
		  	<!-- <view slot="left">选择</view> -->
			<van-cell-group>
				<checkbox></checkbox>
				<van-card :num="item.num" :price="parseFloat(item.price).toFixed(2)" :desc="item.desc" :title="item.title" :thumb="item.thumb">
					<!-- 商品中的标签开始 -->
					<template #tags>
						<van-tag plain type="danger">标签</van-tag>
						<van-tag plain type="danger">标签</van-tag>
					</template>
					<!-- 商品中的标签结束 -->
					<!-- 商品中的步进器开始 -->
					<template #footer>
						<van-stepper />
					</template>
					<!-- 商品中的步进器结束 -->
				</van-card>
			</van-cell-group>
			<view slot="right" @click="onClose(index)">删除</view>
		</van-swipe-cell>
	</view>
</checkbox-group>

在这里插入图片描述
样式调整
在style标签中写如下代码

.van-swipe-cell__right {
		display: inline-block;
		width: 65px;
		height: 100%;
		font-size: 15px;
		line-height: 134px;
		color: #fff;
		text-align: center;
		background-color: #f44;
	}
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值