改进 返回字符串
This commit is contained in:
parent
5fc80dfe60
commit
fafcf479ad
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
{{ $payment }}
|
Loading…
Reference in New Issue
Block a user