update 开发文档

This commit is contained in:
2021-07-13 15:37:27 +08:00
parent 1011b98bab
commit 3469d2d1b3
19 changed files with 648 additions and 309 deletions

View File

@@ -0,0 +1,51 @@
import { Auth } from 'components'
import auth from 'components/authorized/handler'
/**
* 简单的权限标识
*/
function foo1() {
return (
<Auth auth="permissions:name">
<a>连接</a>
</Auth>
)
}
/**
* 多个并且关系的权限标识
*/
function foo2() {
return (
<Auth auth={['permissions:name1', 'permissions:name2']}>
<a>连接</a>
</Auth>
)
}
/**
* 多个或者关系的权限标识
*/
function foo3() {
return (
<Auth auth={[['permissions:name1'], ['permissions:name2']]}>
<a>连接</a>
</Auth>
)
}
/**
* 前缀简化
*/
function foo4() {
return (
<Auth auth={{ permissions: ['name1', 'name2'] }}>
<a>连接</a>
</Auth>
)
}
/**
* 纯js
*/
const flag = auth('permissions:name') // => Boolean