Merge pull request #179 from alimy/jc/alimy

web: go to post detail page if main page not at first when create post success
pull/181/head
Michael Li 3 years ago committed by GitHub
commit 2be1e6def2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,6 +84,18 @@ const loadPosts = () => {
};
const onPostSuccess = (post: Item.PostProps) => {
// 如果不在第一页,需要跳转到详情页面
if (page.value != 1) {
router.push({
name: 'post',
query: {
id: post.id,
},
});
return;
}
// 如果实在第一页,就地插入新推文到文章列表中
let items = [];
let length = list.value.length;
if (length == pageSize.value) {

Loading…
Cancel
Save