ichynul / configx

[laravel-admin]增加/修改配置项,管理网站的配置(Add / edit configuration, Manage site configuration)
https://gitee.com/ichynul/configx
MIT License
32 stars 7 forks source link

how can we remove the image or file when we use multipleimage and multiplefile #16

Closed TheBlueSkim closed 4 years ago

TheBlueSkim commented 4 years ago

When I use multipleimage and multiplefile, I want to remove one item of my uploaded list, but I can't see the operation button, so I add code in Builder.php like this if ($options) { $field = Tool::callUserfunctions($field, $options); if (!in_array($etype, ['image', 'file', 'multiple_image', 'multiple_file'])) { if ($mode == static::UPDATE) { $field->rules('required'); } } else { $field->removable(); } } else { if (in_array($etype, ['image', 'file', 'multiple_image', 'multiple_file'])) { $field->uniqueName(); $field->removable(); } else { if ($mode == static::UPDATE) { $field->rules('required'); } } } now, I see the button, but when I click it, it not works

TheBlueSkim commented 4 years ago

I'm so sorry, I find the option in tips.

TheBlueSkim commented 4 years ago

Emmm, though I use @removable, but it also not works.

ichynul commented 4 years ago

$form->image('picture')->removable(); $form->multipleImage('pictures', 'Pictures')->removable(); Test in a form , is it ok ?

TheBlueSkim commented 4 years ago

In general form, it's ok, but when i use it in plugin, it not works, I found that when i select a new picture, the remove function works, but when i save the change, the old pictures are all deleted, only new picture can be saved. I have no idea with this problem now.

ichynul commented 4 years ago

I has fixed it. it works now.