错误提示: Cannot read property ‘push’ of undefined 状况一: 这个是因为你要push的不是一个数组 解决:你需要将你定义的参数设为数组 data = [] 状况二: 还有一种情况是你设置了数组,但你在刷新后还是会报这个错 那是因为刷新后你定义的参数就为undefined了 解决:所以你需要在js里加个判断就行了 if(this.data === undefined) { this.data = [] }