Loop checkbox in vue vant

Loop checkboxes in vant, the effect is as follows
insert image description here

At the beginning, I didn't know what value should be bound from the returned list for the checked checkbox. If you bind it casually, it will be either all-selected or not all-selected, so you cannot control one by one.

Implementation code: element [undefined when the object attribute is not used]

  <van-swipe-cell v-for="(item, index) in dataList" :key="index">
        <van-row style="display: flex; align-items: center">
          <van-col span="4" style="display: flex; justify-content: center">
            <van-checkbox
              v-model="item.checked"
              @click="rowChange"
            ></van-checkbox>
          </van-col>
          <van-col span="20">
            <van-cell
              :border="true"
              :title="item.rolL_PLAN_NO"
              :value="item.count"
            />
          </van-col>
        </van-row>

The returned list is as follows. You can see that there is no checked attribute.
insert image description here
You can see the following through the vue debugging tool:
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_45989814/article/details/124438706