Skip to content

Commit 2c79fc5

Browse files
committed
* add sub route posts/empty under the route of pages/posts.vue to handle querying with no params
* now will show the `div.container-fluid` when there's no query param in route @ `pages/posts.vue` @ fe
1 parent 4cc26e6 commit 2c79fc5

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

fe/src/app/router.options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export default {
3737
_.isString(to.params.idType) && _.isString(to.params.id)
3838
&& `/posts/${to.params.idType}id/${to.params.id}`
3939
},
40-
postCursorRoute(':pathMatch(.*)*', 'posts/param')
40+
postCursorRoute(':pathMatch(.*)*', 'posts/param'),
41+
postCursorRoute('', 'posts/empty')
4142
];
4243

4344
const userCursorRoute = withCursorRoute(async () => import('@/pages/users.vue'));

fe/src/pages/posts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AMenuItem key="table">表格视图</AMenuItem>
1111
</AMenu>
1212
</aside>
13-
<div v-if="!(data === undefined || _.isEmpty(data.pages) || _.isEmpty(route.params))" class="container-fluid">
13+
<div v-if="!(data === undefined || _.isEmpty(data.pages))" class="container-fluid">
1414
<div class="row flex-nowrap">
1515
<LazyPostNav v-if="renderType === 'list'" :queryParam="queryParam" />
1616
<div class="post-page col mx-auto ps-0" :class="{ 'renderer-list': renderType === 'list' }">

0 commit comments

Comments
 (0)