新增 action 可自定义icon

新增 action 可自定义icon
This commit is contained in:
青芒 2021-12-23 15:05:07 +00:00 committed by Gitee
parent 513eba9195
commit f14a00d630
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -70,11 +70,12 @@ class Actions
* @param string|null $event * @param string|null $event
* @return Button * @return Button
*/ */
public static function normal(string $text, $type = '', string $event = null): Button public static function normal(string $text, $type = '', string $event = null, string $icon = ''): Button
{ {
$button = (new Button) $button = (new Button)
->size('mini') ->size('mini')
->type($type) ->type($type)
->icon($icon)
->text(self::$noText ? '' : $text); ->text(self::$noText ? '' : $text);
if ($event) { if ($event) {