我自己回顾了一下,以前学习的网页修改与删除,也许有不足,还请谅解
修改
html:
<td>
<div class="button-group">
<a class="button border-main" v-on:click="edit(info.nid)"><span class="icon-edit"></span> 修改</a>
<a class="button border-red" v-on:click="del(info.nid,key)"><span class="icon-trash-o" ></span> 删除</a>
</div>
</td>
vue:
edit:function(nid){
window.location.href="/stage/upd?nid="+nid;
},
点击修改,调用edit方法,转跳到控制台。(需要传递nid获取数据库信息)
控制台:
@RequestMapping("/upd")
public String update(HttpServletRequest request,Model model){
int nid = Integer.parseInt(request.getParameter("nid"));
model.addAttribute("nid",ni