我有按钮组件,加载时显示微调器(wire:loading),未加载时显示图标(wire:loading.remove)。
问题是:当按钮调用重定向方法时,此按钮不显示任何内容。就像重定向禁用组件一样。
<button wire:click="trigger" title="{{$text}}" class="btn btn-{{$color}} float-right " >
<div >
<div wire:loading>
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
</div>
<div wire:loading.remove>
@if ($icon)
<i class="fas {{$icon}}"></i>
@endif
</div>
</div>
</button>
public function trigger(){
if(!empty($this->event)){
$this->emit('show-modal');
$this->emit($this->event, $this->params);
}
if($this->url !== null){
return redirect()->to($this->url);
}
}
Livewire version: [v1.3.3]
Laravel version: [v6.18.35]
Browser: [Chrome]