2017-08-01 55 views
-1

當我嘗試獲取我的列表的數據「Id」時,腳本獲取Id錯誤。vuejs獲取<input type =「hidden」的數據

我需要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");*/ 
    }, 
+1

添加正確的代碼。目前它看起來很垃圾給我。 – Pradeepb

+0

您可能需要'v-model',而不是'v-mode',以供初學者使用。 – ceejayoz

回答