Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ant-design-pro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thiago Borges
ant-design-pro
Commits
d867d7e7
Commit
d867d7e7
authored
Jan 10, 2018
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify the document in the mistakes
parent
bb85b06d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
basic.md
src/components/Authorized/demo/basic.md
+5
-3
secured.md
src/components/Authorized/demo/secured.md
+4
-2
No files found.
src/components/Authorized/demo/basic.md
View file @
d867d7e7
...
...
@@ -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 res
lo
ve on behalf of passed
setTimeout(
()=>reslove(),
1000)
// Call res
ol
ve 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={
Havep
ermission} noMatch={noMatch}>
<
Authorized
authority=
{
haveP
ermission
}
noMatch=
{
noMatch
}
>
<
Alert
message=
"Use function as a parameter passed!"
type=
"success"
showIcon
/>
</
Authorized
>
<
Authorized
authority=
{
havePermissionAsync
}
noMatch=
{
noMatch
}
>
...
...
src/components/Authorized/demo/secured.md
View file @
d867d7e7
...
...
@@ -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 res
lo
ve on behalf of passed
setTimeout(() => res
lo
ve(), 1000);
// Call res
ol
ve on behalf of passed
setTimeout
(()
=>
res
ol
ve
(),
1000
);
});
@
Secured
(
'admin'
,
noMatch
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment