Browse Source

Modify the document in the mistakes

pull/654/head
jim 8 years ago
parent
commit
d867d7e7e0
  1. 8
      src/components/Authorized/demo/basic.md
  2. 6
      src/components/Authorized/demo/secured.md

8
src/components/Authorized/demo/basic.md

@ -5,6 +5,8 @@ title:
en-US: Basic
---
Authorized demo used
```jsx
import RenderAuthorized from 'ant-design-pro/lib/Authorized';
import { Alert } from 'antd';
@ -18,8 +20,8 @@ const havePermission = () => {
};
const havePermissionAsync = new Promise((resolve,reject)=>{
// Call reslove on behalf of passed
setTimeout(()=>reslove(),1000)
// Call resolve on behalf of passed
setTimeout( ()=> resolve() , 1000)
});
ReactDOM.render(
@ -30,7 +32,7 @@ ReactDOM.render(
<Authorized authority={['user','admin']} noMatch={noMatch}>
<Alert message="Use Array as a parameter passed!" type="success" showIcon />
</Authorized>
<Authorized authority={Havepermission} noMatch={noMatch}>
<Authorized authority={havePermission} noMatch={noMatch}>
<Alert message="Use function as a parameter passed!" type="success" showIcon />
</Authorized>
<Authorized authority={havePermissionAsync} noMatch={noMatch}>

6
src/components/Authorized/demo/secured.md

@ -5,6 +5,8 @@ title:
en-US: secured
---
secured demo used
```jsx
import RenderAuthorized from 'ant-design-pro/lib/Authorized';
import { Alert } from 'antd';
@ -17,8 +19,8 @@ const havePermission = () => {
};
const havePermissionAsync = new Promise((resolve, reject) => {
// Call reslove on behalf of passed
setTimeout(() => reslove(), 1000);
// Call resolve on behalf of passed
setTimeout(() => resolve(), 1000);
});
@Secured('admin', noMatch)

Loading…
Cancel
Save