先将id打印出来看一看,然后代码改进 // this.userList.forEach... this.userInfo = this.userList.find(item => item.id === id)
路由里取到的id是字符串类型的,你的对象里的id是整数类型的