fix(projects): Fix secondary directory components is empty

This commit is contained in:
paynezhuang 2024-06-13 22:48:07 +08:00
parent adf8c20a3c
commit 7ff6e5c2c6

View File

@ -6,7 +6,7 @@ export function getLayoutAndPage(component?: string | null) {
let layout = '';
let page = '';
const [layoutOrPage, pageItem] = component?.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT) || [];
const [layoutOrPage = '', pageItem = ''] = component?.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT) || [];
layout = getLayout(layoutOrPage);
page = getPage(pageItem || layoutOrPage);