Browse Source

style: prettier SiderMenu.js (#3501)

* style: prettier SiderMenu.js

* new config file
pull/3506/head
陈帅 8 years ago
committed by GitHub
parent
commit
2f1c4631c3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      azure-pipelines.yml
  2. 5
      src/components/SiderMenu/SiderMenu.js

16
azure-pipelines.yml

@ -5,10 +5,7 @@
name: ant design pro name: ant design pro
trigger: trigger:
batch: true - master
branches:
exclude:
- gh-pages
jobs: jobs:
- job: lintAndBuild - job: lintAndBuild
@ -18,13 +15,14 @@ jobs:
steps: steps:
- checkout: self - checkout: self
fetchDepth: 1
clean: false clean: false
- script: yarn install - script: yarn install
displayName: install displayName: install
- script: npm run lint - script: npm run lint
displayName: lint displayName: lint
- script: npm run build - script: npm run build
env:
PROGRESS: none
displayName: build displayName: build
- job: test - job: test
@ -42,6 +40,8 @@ jobs:
- script: yarn install - script: yarn install
displayName: install displayName: install
- script: npm run test:all - script: npm run test:all
env:
PROGRESS: none
displayName: test displayName: test
- job: Windows - job: Windows
@ -59,6 +59,8 @@ jobs:
- script: npm run lint - script: npm run lint
displayName: lint displayName: lint
- script: npm run build - script: npm run build
env:
PROGRESS: none
displayName: build displayName: build
- job: MacOS - job: MacOS
@ -75,5 +77,7 @@ jobs:
displayName: install displayName: install
- script: npm run lint - script: npm run lint
displayName: lint displayName: lint
- script: npm run build - script: npm run
env:
PROGRESS: none
displayName: build displayName: build

5
src/components/SiderMenu/SiderMenu.js

@ -25,10 +25,7 @@ export default class SiderMenu extends PureComponent {
static getDerivedStateFromProps(props, state) { static getDerivedStateFromProps(props, state) {
const { pathname, flatMenuKeysLen } = state; const { pathname, flatMenuKeysLen } = state;
if ( if (props.location.pathname !== pathname || props.flatMenuKeys.length !== flatMenuKeysLen) {
props.location.pathname !== pathname ||
props.flatMenuKeys.length !== flatMenuKeysLen
) {
return { return {
pathname: props.location.pathname, pathname: props.location.pathname,
flatMenuKeysLen: props.flatMenuKeys.length, flatMenuKeysLen: props.flatMenuKeys.length,

Loading…
Cancel
Save