Skip to content

Commit

Permalink
fix(projects): fix update redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Sep 8, 2023
1 parent ade7398 commit c14aaca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ stats.html

package-lock.json
yarn.lock
pnmp-lock.yaml
pnmp-lock.yaml

.VSCodeCounter
3 changes: 1 addition & 2 deletions packages/vue/src/context/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { loadFile, generateCode } from 'magicast';
import { parse } from 'recast/parsers/typescript';
import type { ElegantRouterTree } from '@elegant-router/core';
import { createPrefixCommentOfGenFile } from './comment';

import { formatCode } from '../shared/prettier';
import { LAYOUT_PREFIX, VIEW_PREFIX } from '../constants';
import type { ElegantVueRouterOption, AutoRoute } from '../types';
Expand Down Expand Up @@ -95,7 +94,7 @@ export function getUpdatedRouteConst(oldConst: AutoRoute[], newConst: AutoRoute[
if (findItem.redirect) {
const { children = [] } = findItem;

const childrenNames = children.map(i => i.name);
const childrenNames = children?.map(i => i.name) || [];

const { name: redirectName } = findItem.redirect as { name: string };

Expand Down

0 comments on commit c14aaca

Please sign in to comment.