【发布时间】:2017-10-19 23:32:58
【问题描述】:
我有一个如下所示的表格:
<table class="table">
<thead>
<tr>
<td><strong>Title</strong></td>
<td><strong>Job</strong></td>
<td></td>
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in rows">
<td><p class="title">My title</p></td>
<td><input type="text" v-model="row.job"></td>
<td><a @click="title()">Remove title</a></td>
</tr>
</tbody>
</table>
现在我想知道当单击删除标题链接时,如何在 <p class="title">My title</p> 上切换 jquery .hide()。
我不想使用v-show,因为我想了解如何在 vueJS 的动态生成行中定位元素。
问题是我的表中有很多行,所以每个标题标签都必须有一个 uniqe 类,我不明白如何在动态生成的行上隐藏特定标题
【问题讨论】: