diff --git a/package.json b/package.json index 2e44151aea73d11914021a800e05185c98e7a9cb..541c7152d47497a3b3095210137006606c7c0961 100755 --- a/package.json +++ b/package.json @@ -5,9 +5,10 @@ "private": true, "scripts": { "precommit": "npm run lint-staged", - "start": "cross-env ESLINT=none roadhog dev", + "start": "HARD_SOURCE=none cross-env ESLINT=none roadhog dev", "start:no-proxy": "cross-env NO_PROXY=true ESLINT=none roadhog dev", "build": "cross-env ESLINT=none roadhog build", + "build-site": "roadhog-api-doc static", "site": "roadhog-api-doc static && gh-pages -d dist", "analyze": "cross-env ANALYZE=true roadhog build", "lint:style": "stylelint \"src/**/*.less\" --syntax less", @@ -40,10 +41,10 @@ "prop-types": "^15.5.10", "qs": "^6.5.0", "rc-drawer-menu": "^1.1.0", - "react": "^16.3.1", + "react": "^16.4.0", "react-container-query": "^0.11.0", "react-document-title": "^2.0.3", - "react-dom": "^16.3.1", + "react-dom": "^16.4.0", "react-fittext": "^1.0.0", "rollbar": "^2.3.4", "url-polyfill": "^1.0.10" diff --git a/src/components/Login/LoginTab.js b/src/components/Login/LoginTab.js index 30e84ccbf1b4cba85ee3eaf7905b69c253ea3e85..ea42fc8e4fa1409216c51586c6adbcdfc26f1d23 100644 --- a/src/components/Login/LoginTab.js +++ b/src/components/Login/LoginTab.js @@ -21,15 +21,20 @@ class LoginTab extends Component { this.props.tabUtil.addTab(this.uniqueId); } render() { - return ; + return {this.props.children}; } } const warpContext = props => { return ( - {value => } + {value => { + return ; + }} ); }; +// 标志位 用来判断是不是自定义组件 +warpContext.typeName = 'LoginTab'; + export default warpContext; diff --git a/src/components/Login/index.js b/src/components/Login/index.js index 686358e0f45175c5240c1579080571c641aa692d..702c13f1f7d759e161ef12a87c6f5610e527a532 100644 --- a/src/components/Login/index.js +++ b/src/components/Login/index.js @@ -78,7 +78,7 @@ class Login extends Component { return; } // eslint-disable-next-line - if (item.type.name === 'warpContext') { + if (item.type.typeName === 'LoginTab') { TabChildren.push(item); } else { otherChildren.push(item); diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index 830db64f8fccd88aaae733046a67c2f481e137f3..6d64a4a3cc507561c8fc3b99d79c041b70ccecae 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -233,7 +233,7 @@ export default class SiderMenu extends PureComponent { width={256} className={`${styles.sider} ${theme === 'light' ? styles.light : ''}`} > -
+