Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
krissss committed Dec 8, 2022
1 parent 4800db0 commit 5a7966e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 24 deletions.
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,11 @@ Amis 组件的封装,目前仅封装了常用的组件类型和属性, 但 a

> 组件支持 Controller 级别和全局(config中)修改默认配置参数
### 多应用支持

1. 复制一份 `config/plugin/webman-tech/amis-admin/amis.php``config/plugin/webman-tech/amis-admin/amis-user.php`

2. 继承 `AmisModuleChangeMiddleware` 实现一个无 `__construct` 的中间件(因为 webman 目前还不支持中间件注册使用 __construct),例如:

```php
<?php

namespace app\middleware;

use WebmanTech\AmisAdmin\Middleware\AmisModuleChangeMiddleware;

class AmisModuleChange2User extends AmisModuleChangeMiddleware
{
public function __construct()
{
parent::__construct('amis-user');
}
}
```

3. 在响应的路由或全局中间件中引入 `AmisModuleChange2User`

## 注意点

1. 如果使用 LaravelValidator,校验 file 时需要安装依赖:`webman-tech/polyfill`

## 其他

- [多应用支持](./docs/multi_app.md)
- [常用配置](./docs/common_usage.md)
21 changes: 21 additions & 0 deletions docs/common_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 常用配置

<details>
<summary>如何修改 crud 的详情打开的 dialog 的 size</summary>
在对应的 controller 中添加以下配置
<pre>
/**
* @inheritdoc
*/
protected function gridActionsConfig(): array
{
return [
'schema_detail' => [
'dialog' => [
'size' => 'lg',
],
],
];
}
</pre>
</details>
23 changes: 23 additions & 0 deletions docs/multi_app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 多应用支持

1. 复制一份 `config/plugin/webman-tech/amis-admin/amis.php``config/plugin/webman-tech/amis-admin/amis-user.php`

2. 继承 `AmisModuleChangeMiddleware` 实现一个无 `__construct` 的中间件(因为 webman 目前还不支持中间件注册使用 __construct),例如:

```php
<?php

namespace app\middleware;

use WebmanTech\AmisAdmin\Middleware\AmisModuleChangeMiddleware;

class AmisModuleChange2User extends AmisModuleChangeMiddleware
{
public function __construct()
{
parent::__construct('amis-user');
}
}
```

3. 在相应的路由或全局中间件中引入 `AmisModuleChange2User`

0 comments on commit 5a7966e

Please sign in to comment.