购物车案例
HTML部分
<div id="app">
<table>
<thead>
<tr>
<th for="checkAll">全选
<input type="checkbox" id="checkAll" v-model="isAll" @change="checkAll">
</th>
<th>名称</th>
<th>价格</th>
<th>数量</th>
</tr>
</thead>
<tbody>
<thead v-for="item in goodList" :key="item.id">
<tr>
<td>
<input
type="checkbox"
:id="item.id"
v-model="checkedGoods"
:value="item"
@change="checkOne"
>
</td>
<td>{
{
item.tit}}</td>
<td>{
{
item.price | addRMB}}</td>
<td>
<button @click="reduce(item)">-</button>
<span>{
{
item.num}