【发布时间】:2018-01-08 20:55:54
【问题描述】:
当我尝试获取列表的数据“Id”时,脚本的 Id 错误。
我需要那个字段的 ID。但我的回报是错误的
<input type="hidden" name="Id" id="Id" v-mode="todo.Id">
我一直使用隐藏,因为如果不使用隐藏输入,我无法获得该 ID
</tr>
<tr v-for="todo in todos">
<td>{{todo.filial}} Id {{todo.Id}}<input type="hidden" name="Id" id="Id" v-mode="todo.Id"></td>
Deletar: function (event){
alert($('#Id').val());
/*$.post( "Salva.php", { textoDoFormulario: this.todosView.Id, status: "delete" } );
$.get('t2576.php', function(resp) {
todosView.todos = resp;
}, "json");*/
},
【问题讨论】:
-
添加正确的代码。目前对我来说它看起来很垃圾。
-
对于初学者,您可能想要
v-model,而不是v-mode。