|
|
||
|---|---|---|
| config | ||
| database/migrations | ||
| docs | ||
| fonts | ||
| packages | ||
| resources | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .env.testing | ||
| .gitattributes | ||
| .gitignore | ||
| .styleci.yml | ||
| LICENSE | ||
| README.md | ||
| composer.json | ||
| package.json | ||
| phpunit.dusk.xml | ||
| webpack.mix.js | ||
README.md
Dcat-Admin
Fork From jqhph/dcat-admin
安装
composer config repositories.peidikeji/dcat-admin git git@gitee.com:paddy_technology/dcat-admin.gitcomposer require peidikeji/dcat-admin
改动
- 文件:
dcat-admin/src/Form/Footer.php, 将reset按钮默认设置为false
protected $buttons = ['reset' => false, 'submit' => true, 'back' => true];
public function disableBack(bool $disable = true)
{
$this->buttons['back'] = !$disable;
}
- 添加 Form 表单的
back按钮, 文件:dcat-admin/resources/views/form/footer.blade.php
@if(! empty($buttons['back']))
<div class="btn-group pull-left">
<a href="javascript:window.history.back()" class="btn btn-white"><i class="feather icon-arrow-left"></i> {{ trans('admin.back') }}</a>
</div>
@endif
- 文件:
dcat-admin/src/Show/Tools.php, 添加back按钮,list默认设置为false, 修改按钮的渲染方式(去掉外层的btn-group标签, 添加类名mr-1)
protected $tools = ['back', 'list', 'edit', 'delete'];
protected $showBack = true;
public function disableBack(bool $disable = true)
{
$this->showBack = !$disable;
return $this;
}
protected function renderBack()
{
if (! $this->showBack) {
return;
}
$back = trans('admin.back');
return <<<HTML
<a href="javascript:window.history.back()" class="btn btn-sm btn-primary mr-1">
<i class="feather icon-arrow-left"></i><span class="d-none d-sm-inline"> {$back}</span>
</a>
HTML;
}