Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
166 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: | ||
zh-CN: 基础样例 | ||
en-US: Basic Usage | ||
order: 0 | ||
--- | ||
|
||
## zh-CN | ||
|
||
最简单的用法。 | ||
|
||
## en-US | ||
|
||
Simplest of usage. | ||
|
||
```ts | ||
import { Component } from '@angular/core'; | ||
import { ACLService } from '@delon/acl'; | ||
import { SFSchema } from '@delon/form'; | ||
import { NzMessageService } from 'ng-zorro-antd'; | ||
|
||
@Component({ | ||
selector: 'app-demo', | ||
template: ` | ||
<sf [schema]="schema" (formSubmit)="submit($event)"></sf> | ||
<button nz-button nzType="primary" (click)="acl.setFull(true)">Full</button> | ||
<button nz-button nzType="primary" (click)="acl.setFull(false)">Not Full</button> | ||
<button nz-button nzType="primary" (click)="acl.setRole(['admin'])">Admin Role</button> | ||
<button nz-button nzType="primary" (click)="acl.setRole(['user'])">User Role</button> | ||
`, | ||
}) | ||
export class DemoComponent { | ||
schema: SFSchema = { | ||
properties: { | ||
name: { | ||
type: 'string', | ||
title: 'name-user', | ||
ui: { | ||
acl: 'user', | ||
}, | ||
}, | ||
age: { | ||
type: 'string', | ||
title: 'age-admin', | ||
ui: { | ||
acl: 'admin', | ||
}, | ||
}, | ||
}, | ||
required: ['name'], | ||
}; | ||
constructor(public msg: NzMessageService, public acl: ACLService) { | ||
} | ||
submit(value: any) { | ||
this.msg.success(JSON.stringify(value)); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: acl | ||
subtitle: ACL | ||
type: Examples | ||
--- | ||
|
||
结合 `@delon/acl` 权限可以利用一个 Schema 来构建不同角色或权限点的表单。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters