chore: 优化权限菜单

This commit is contained in:
JaguarJack
2023-04-07 08:13:40 +08:00
parent aca12126b5
commit 23f2b7e861
5 changed files with 42 additions and 35 deletions

View File

@@ -24,8 +24,13 @@ class Components implements OptionInterface
$components = File::glob(CatchAdmin::getModuleViewsPath($module).'*'.DIRECTORY_SEPARATOR.'*.vue');
foreach ($components as $component) {
$_component = Str::of($component)
->replace(CatchAdmin::moduleRootPath(), '')
->explode(DIRECTORY_SEPARATOR);
$_component->shift(2);
$this->components[] = [
'label' => Str::of($component)->explode(DIRECTORY_SEPARATOR)->pop(2)->pop(),
'label' => Str::of($_component->implode('/'))->replace('.vue', ''),
'value' => Str::of($component)->replace(CatchAdmin::moduleRootPath(), '')->prepend('/')
];