mymain.vue
<template>
<div class="box">
<table class="table table-hover">
<thead>
<tr>
<th><input type="checkbox" class="check" v-model="isall" /></th>
<th>项目</th>
<th>单价</th>
<th>数量</th>
<th>总价</th>
</tr>
</thead>
<tbody v-for="obj in list" :key="obj.id">
<tr>
<td><input type="checkbox" class="check" v-model="obj.isdone" /></td>
<td>{ { obj.name }}</td>
<td>¥{ { obj.price }}</td>
<td>
<button
@click="obj.count > 1 && obj.count--"
:disabled="obj.count == 1"
:class="{ tra: obj.count == 1 }"
>
-