Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/components/Authorized/demo/basic.md
src/components/Authorized/demo/basic.md
+5
-3
src/components/Authorized/demo/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:
...
@@ -5,6 +5,8 @@ title:
en-US
:
Basic
en-US
:
Basic
---
---
Authorized demo used
```
jsx
```
jsx
import
RenderAuthorized
from
'
ant-design-pro/lib/Authorized
'
;
import
RenderAuthorized
from
'
ant-design-pro/lib/Authorized
'
;
import
{
Alert
}
from
'
antd
'
;
import
{
Alert
}
from
'
antd
'
;
...
@@ -18,8 +20,8 @@ const havePermission = () => {
...
@@ -18,8 +20,8 @@ const havePermission = () => {
};
};
const
havePermissionAsync
=
new
Promise
((
resolve
,
reject
)
=>
{
const
havePermissionAsync
=
new
Promise
((
resolve
,
reject
)
=>
{
// Call res
lo
ve on behalf of passed
// Call res
ol
ve on behalf of passed
setTimeout
(
()
=>
reslove
(),
1000
)
setTimeout
(
()
=>
resolve
()
,
1000
)
});
});
ReactDOM
.
render
(
ReactDOM
.
render
(
...
@@ -30,7 +32,7 @@ ReactDOM.render(
...
@@ -30,7 +32,7 @@ ReactDOM.render(
<
Authorized
authority
=
{
[
'
user
'
,
'
admin
'
]
}
noMatch
=
{
noMatch
}
>
<
Authorized
authority
=
{
[
'
user
'
,
'
admin
'
]
}
noMatch
=
{
noMatch
}
>
<
Alert
message
=
"Use Array as a parameter passed!"
type
=
"success"
showIcon
/>
<
Alert
message
=
"Use Array as a parameter passed!"
type
=
"success"
showIcon
/>
</
Authorized
>
</
Authorized
>
<
Authorized
authority
=
{
Havep
ermission
}
noMatch
=
{
noMatch
}
>
<
Authorized
authority
=
{
haveP
ermission
}
noMatch
=
{
noMatch
}
>
<
Alert
message
=
"Use function as a parameter passed!"
type
=
"success"
showIcon
/>
<
Alert
message
=
"Use function as a parameter passed!"
type
=
"success"
showIcon
/>
</
Authorized
>
</
Authorized
>
<
Authorized
authority
=
{
havePermissionAsync
}
noMatch
=
{
noMatch
}
>
<
Authorized
authority
=
{
havePermissionAsync
}
noMatch
=
{
noMatch
}
>
...
...
src/components/Authorized/demo/secured.md
View file @
d867d7e7
...
@@ -5,6 +5,8 @@ title:
...
@@ -5,6 +5,8 @@ title:
en-US
:
secured
en-US
:
secured
---
---
secured demo used
```
jsx
```
jsx
import
RenderAuthorized
from
'
ant-design-pro/lib/Authorized
'
;
import
RenderAuthorized
from
'
ant-design-pro/lib/Authorized
'
;
import
{
Alert
}
from
'
antd
'
;
import
{
Alert
}
from
'
antd
'
;
...
@@ -17,8 +19,8 @@ const havePermission = () => {
...
@@ -17,8 +19,8 @@ const havePermission = () => {
};
};
const
havePermissionAsync
=
new
Promise
((
resolve
,
reject
)
=>
{
const
havePermissionAsync
=
new
Promise
((
resolve
,
reject
)
=>
{
// Call res
lo
ve on behalf of passed
// Call res
ol
ve on behalf of passed
setTimeout
(()
=>
res
lo
ve
(),
1000
);
setTimeout
(()
=>
res
ol
ve
(),
1000
);
});
});
@
Secured
(
'
admin
'
,
noMatch
)
@
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