引入:
<li v-for="(item,index) in cart">
<!-- Card -->
<van-checkbox
v-model="item.danxuan"
class="checkedBox"
@change="singleChecked(item.danxuan,index)">
</van-checkbox>
<van-card
:title="item.pro_title"
desc="描述"
:num="item.buyNum"
:price="item.pro_price"
:thumb="imageURL"
>
<div slot="footer">
<span class="xiaoji">小计:{
{(parseFloat(item.pro_price)*parseFloat(item.buyNum)).toFixed(2)}}</span>
<span><van-stepper v-model="item.buyNum" /></span>
</div>
</van-card>
</li>
放在li里循环,加入danxan判断参数。引用card组件。--购物车提交订单页面
vant组件,复选框点击事件@change,这里的事件会监听事件参数,比如item.danxuan,当参数更改时,事件会监听
test代码
<template>
<div class="sort-page">
<div class="home">