提交 4e62a9f2 编写于 作者: C chenshuai2144

lint: fix ts error

上级 a6109418
...@@ -11,7 +11,7 @@ jobs: ...@@ -11,7 +11,7 @@ jobs:
- job: lintAndBuild - job: lintAndBuild
pool: pool:
vmImage: "Ubuntu-16.04" vmImage: 'Ubuntu-16.04'
steps: steps:
- checkout: self - checkout: self
...@@ -29,11 +29,11 @@ jobs: ...@@ -29,11 +29,11 @@ jobs:
- job: test - job: test
pool: pool:
vmImage: "Ubuntu-16.04" vmImage: 'Ubuntu-16.04'
container: container:
image: circleci/node:latest-browsers image: circleci/node:latest-browsers
options: "-u root" options: '-u root'
steps: steps:
- script: npm install - script: npm install
...@@ -46,11 +46,11 @@ jobs: ...@@ -46,11 +46,11 @@ jobs:
- job: Windows - job: Windows
pool: pool:
vmImage: "win1803" vmImage: 'win1803'
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "11.x" versionSpec: '11.x'
- script: npm install - script: npm install
displayName: install displayName: install
- script: npm run lint - script: npm run lint
...@@ -69,11 +69,11 @@ jobs: ...@@ -69,11 +69,11 @@ jobs:
- job: MacOS - job: MacOS
pool: pool:
vmImage: "macOS-latest" vmImage: 'macOS-latest'
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "11.x" versionSpec: '11.x'
- script: npm install - script: npm install
displayName: install displayName: install
- script: npm run lint - script: npm run lint
......
...@@ -155,7 +155,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => { ...@@ -155,7 +155,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => {
)} )}
onCollapse={handleMenuCollapse} onCollapse={handleMenuCollapse}
menuItemRender={(menuItemProps, defaultDom) => { menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || menuItemProps.children) { if (menuItemProps.isUrl || menuItemProps.children || !menuItemProps.path) {
return defaultDom; return defaultDom;
} }
return <Link to={menuItemProps.path}>{defaultDom}</Link>; return <Link to={menuItemProps.path}>{defaultDom}</Link>;
......
...@@ -30,7 +30,7 @@ export const getPageQuery = () => parse(window.location.href.split('?')[1]); ...@@ -30,7 +30,7 @@ export const getPageQuery = () => parse(window.location.href.split('?')[1]);
* @param router [{}] * @param router [{}]
* @param pathname string * @param pathname string
*/ */
export const getAuthorityFromRouter = <T extends { path: string }>( export const getAuthorityFromRouter = <T extends { path?: string }>(
router: T[] = [], router: T[] = [],
pathname: string, pathname: string,
): T | undefined => { ): T | undefined => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册