{"action":"closed","issue":{"url":"https://api.github.com/repos/qiqingfu/vue-Impression--notes/issues/7","repository_url":"https://api.github.com/repos/qiqingfu/vue-Impression--notes","labels_url":"https://api.github.com/repos/qiqingfu/vue-Impression--notes/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/qiqingfu/vue-Impression--notes/issues/7/comments","events_url":"https://api.github.com/repos/qiqingfu/vue-Impression--notes/issues/7/events","html_url":"https://github.com/qiqingfu/vue-Impression--notes/issues/7","id":321673391,"number":7,"title":"删除笔记最后一条,报错id找不到的问题解决","user":{"login":"qiqingfu","id":36329267,"avatar_url":"https://avatars1.githubusercontent.com/u/36329267?v=4","gravatar_id":"","url":"https://api.github.com/users/qiqingfu","html_url":"https://github.com/qiqingfu","followers_url":"https://api.github.com/users/qiqingfu/followers","following_url":"https://api.github.com/users/qiqingfu/following{/other_user}","gists_url":"https://api.github.com/users/qiqingfu/gists{/gist_id}","starred_url":"https://api.github.com/users/qiqingfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiqingfu/subscriptions","organizations_url":"https://api.github.com/users/qiqingfu/orgs","repos_url":"https://api.github.com/users/qiqingfu/repos","events_url":"https://api.github.com/users/qiqingfu/events{/privacy}","received_events_url":"https://api.github.com/users/qiqingfu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-09T18:16:29Z","updated_at":"2018-05-20T16:11:58Z","closed_at":"2018-05-20T16:11:58Z","author_association":"OWNER","body":"当删除某条数据时,会找到vuex中allList笔记列表(数组)。找到当前删除对象的当前下标的下一个对象,取出id。等当前这个对象删除之后把下一个对象的id,push({path:''}) 到路由中获取到下一个展示对象的数据。\r\n删除最后一个对象。因为当前这个对象的下标后一个没有,所以是个空对象,在空对象身上找id会报错\r\n\r\n解决: 判断下一个对象的有没有,如果有就取到下一个对象的id,展示数据\r\n        如果没有说明删除的是最后一个对象,就找当前下标的前一个对象的id\r\n"}}
{"actor":{"display_login":"qiqingfu"}}