diff --git a/package.json b/package.json index 7c0ad688fdaaccc0773f905974203b777e45739a..5389c2500754fa98caad426b320e24c1cd21492a 100755 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "precommit": "npm run lint-staged", "start": "cross-env DISABLE_ESLINT=true roadhog dev", - "start:no-proxy": "cross-env NO_PROXY=true roadhog dev", - "build": "roadhog build", + "start:no-proxy": "cross-env NO_PROXY=true DISABLE_ESLINT=true roadhog dev", + "build": "cross-env DISABLE_ESLINT=true roadhog build", "site": "roadhog-api-doc static && gh-pages -d dist", "analyze": "roadhog build --analyze", "lint:style": "stylelint \"src/**/*.less\" --syntax less", diff --git a/src/components/Authorized/demo/basic.md b/src/components/Authorized/demo/basic.md index c9694ad21d54ac879cb641eb84eca50ec82a85a2..48eb7c4459dbf30f2d5fffc7fd55fb5dea0ad3d5 100644 --- a/src/components/Authorized/demo/basic.md +++ b/src/components/Authorized/demo/basic.md @@ -36,7 +36,7 @@ ReactDOM.render( - - mountNode, + , + mountNode ); ``` diff --git a/src/components/Authorized/demo/secured.md b/src/components/Authorized/demo/secured.md new file mode 100644 index 0000000000000000000000000000000000000000..2ff7c2de0a0366d0286014d8f7f3cd8e8434b962 --- /dev/null +++ b/src/components/Authorized/demo/secured.md @@ -0,0 +1,73 @@ +--- +order: 1 +title: + zh-CN: 注解 + en-US: secured +--- + +```jsx +import RenderAuthorized from 'ant-design-pro/lib/Authorized'; +import { Alert } from 'antd'; + +const { Secured } = RenderAuthorized('user'); +const noMatch = ; + +const havePermission = () => { + return false; +}; + +const havePermissionAsync = new Promise((resolve, reject) => { + // Call reslove on behalf of passed + setTimeout(() => reslove(), 1000); +}); + +@Secured('admin', noMatch) +class TestSecuredString extends React.Component { + render() { + ; + } +} + +@Secured(['user', 'admin'], noMatch) +class TestSecuredArray extends React.Component { + render() { + ; + } +} + +@Secured(havePermission, noMatch) +class TestSecuredFunction extends React.Component { + render() { + ; + } +} + +@Secured(havePermissionAsync, noMatch) +class TestSecuredPromise extends React.Component { + render() { + ; + } +} + +ReactDOM.render( +
+ + + + +
, + mountNode, +); +``` diff --git a/src/components/Ellipsis/index.js b/src/components/Ellipsis/index.js index 3ddbc8e579a1f926bc89029e0a21433c37e77cb6..ae4019ce7ee6971382cd71b7b9a87e24d3a384eb 100644 --- a/src/components/Ellipsis/index.js +++ b/src/components/Ellipsis/index.js @@ -171,7 +171,7 @@ export default class Ellipsis extends Component {
{ - tooltip ? ({children}) : children + tooltip ? ({children}) : children }
); } diff --git a/src/components/GlobalFooter/demo/basic.md b/src/components/GlobalFooter/demo/basic.md index 7662fa9f7ed57008dcbb879e8e13ea3282847992..9a06bade622c4657dd9b39fa97c2e267c119d14c 100644 --- a/src/components/GlobalFooter/demo/basic.md +++ b/src/components/GlobalFooter/demo/basic.md @@ -15,7 +15,7 @@ const links = [{ title: '帮助', href: '', }, { - key: 'github' + key: 'github', title: , href: 'https://github.com/ant-design/ant-design-pro', blankTarget: true, diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 3b2487bd724b88b0d0eeedd6c319161a74bdcf89..01228a51f6b1c1952ce761b7674c3ac417aeddbd 100644 --- a/src/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Link, Route } from 'dva/router'; +import { Link, Redirect, Switch, Route } from 'dva/router'; import DocumentTitle from 'react-document-title'; import { Icon } from 'antd'; import GlobalFooter from '../components/GlobalFooter'; @@ -47,8 +47,8 @@ class UserLayout extends React.PureComponent {
Ant Design 是西湖区最具影响力的 Web 设计规范
- { - getRoutes(match.path, routerData).map(item => + + {getRoutes(match.path, routerData).map(item => ( ) - ) - } + )} + +