From 4e62a9f2788de5a0f1a574b1e2ce570fa6b5c5a7 Mon Sep 17 00:00:00 2001 From: chenshuai2144 Date: Mon, 30 Dec 2019 11:58:25 +0800 Subject: [PATCH] lint: fix ts error --- azure-pipelines.yml | 14 +++++++------- src/layouts/BasicLayout.tsx | 2 +- src/utils/utils.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 064c3462..de92a14f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,7 +11,7 @@ jobs: - job: lintAndBuild pool: - vmImage: "Ubuntu-16.04" + vmImage: 'Ubuntu-16.04' steps: - checkout: self @@ -29,11 +29,11 @@ jobs: - job: test pool: - vmImage: "Ubuntu-16.04" + vmImage: 'Ubuntu-16.04' container: image: circleci/node:latest-browsers - options: "-u root" + options: '-u root' steps: - script: npm install @@ -46,11 +46,11 @@ jobs: - job: Windows pool: - vmImage: "win1803" + vmImage: 'win1803' steps: - task: NodeTool@0 inputs: - versionSpec: "11.x" + versionSpec: '11.x' - script: npm install displayName: install - script: npm run lint @@ -69,11 +69,11 @@ jobs: - job: MacOS pool: - vmImage: "macOS-latest" + vmImage: 'macOS-latest' steps: - task: NodeTool@0 inputs: - versionSpec: "11.x" + versionSpec: '11.x' - script: npm install displayName: install - script: npm run lint diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index ca2a2415..7ef557ce 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -155,7 +155,7 @@ const BasicLayout: React.FC = props => { )} onCollapse={handleMenuCollapse} menuItemRender={(menuItemProps, defaultDom) => { - if (menuItemProps.isUrl || menuItemProps.children) { + if (menuItemProps.isUrl || menuItemProps.children || !menuItemProps.path) { return defaultDom; } return {defaultDom}; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index b9ce15df..82e14a32 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -30,7 +30,7 @@ export const getPageQuery = () => parse(window.location.href.split('?')[1]); * @param router [{}] * @param pathname string */ -export const getAuthorityFromRouter = ( +export const getAuthorityFromRouter = ( router: T[] = [], pathname: string, ): T | undefined => {