basic.md 487 Bytes
Newer Older
ddcat1115's avatar
ddcat1115 committed
1 2 3
---
order: 0
title: 
jim's avatar
jim committed
4 5
  zh-CN: 基本使用
  en-US: Basic use
ddcat1115's avatar
ddcat1115 committed
6 7
---

jim's avatar
jim committed
8
Basic use
jim's avatar
jim committed
9

jim's avatar
jim committed
10 11 12 13 14 15 16 17
```jsx
import RenderAuthorized from 'ant-design-pro/lib/Authorized';
import { Alert } from 'antd';

const Authorized = RenderAuthorized('user');
const noMatch = <Alert message="No permission." type="error" showIcon />;

ReactDOM.render(
jim's avatar
jim committed
18 19 20 21
  <div>
    <Authorized authority="admin" noMatch={noMatch}>
      <Alert message="user Passed!" type="success" showIcon />
    </Authorized>
22
  </div>,
jim's avatar
jim committed
23
  mountNode,
jim's avatar
jim committed
24 25
);
```