改进 返回字符串

This commit is contained in:
iVampireSP.com 2023-02-13 01:53:59 +08:00
parent 5fc80dfe60
commit fafcf479ad
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 3 additions and 5 deletions

View File

@ -2,7 +2,6 @@
namespace App\View\Components;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Payment extends Component
@ -22,9 +21,9 @@ public function __construct(string|null $payment)
/**
* Get the view / contents that represent the component.
*
* @return View
* @return string
*/
public function render(): View
public function render(): string
{
$this->payment = match ($this->payment) {
'alipay' => '支付宝',
@ -39,6 +38,6 @@ public function render(): View
default => $this->payment,
};
return view('components.payment', ['payment' => $this->payment]);
return $this->payment;
}
}

View File

@ -1 +0,0 @@
{{ $payment }}