fix(vue): correctly render child pages in tabs (#22141)

This commit is contained in:
Liam DeBeasi
2020-09-22 14:41:26 -04:00
committed by GitHub
parent 6ac6810148
commit 7e449a1ca6
2 changed files with 30 additions and 2 deletions

View File

@ -6,6 +6,14 @@ import { RouteInfo,
export const createViewStacks = () => {
let viewStacks: ViewStacks = {};
const tabsPrefixes = new Set();
const addTabsPrefix = (prefix: string) => tabsPrefixes.add(prefix);
const hasTabsPrefix = (path: string) => {
const values = Array.from(tabsPrefixes.values());
const hasPrefix = values.find((v: string) => path.includes(v));
return hasPrefix !== undefined;
}
const getViewStack = (outletId: number) => {
return viewStacks[outletId];
@ -92,6 +100,8 @@ export const createViewStacks = () => {
}
return {
addTabsPrefix,
hasTabsPrefix,
findViewItemByRouteInfo,
findLeavingViewItemByRouteInfo,
createViewItem,