在按钮的点击事件中,传参的类型为String类型的解决方案 <button type="button" class="btn btn-primary" οnclick=\"update('"+val.id+"')\"></button> 解释: \" :转义,表示双引号(")