Php Livewire/Blade组件中的渲染变量
我有一个包含多个模态的表,我正在尝试测试在循环中传递行id,以确保我的模态正常工作。但是我无法通过Livewire组件获取要显示的变量值 Livewire组件Php Livewire/Blade组件中的渲染变量,php,laravel,laravel-blade,laravel-livewire,Php,Laravel,Laravel Blade,Laravel Livewire,我有一个包含多个模态的表,我正在尝试测试在循环中传递行id,以确保我的模态正常工作。但是我无法通过Livewire组件获取要显示的变量值 Livewire组件 <livewire:dashboard.actions :apt_id="$appointments->id"/> 这是因为我需要删除mount()并将变量更改为camelCase。您确定它传递了您假定的值吗?执行dd($apt\u id)。 <div><button wire:c
<livewire:dashboard.actions :apt_id="$appointments->id"/>
这是因为我需要删除
mount()
并将变量更改为camelCase。您确定它传递了您假定的值吗?执行dd($apt\u id)要检查的mount()
方法中的code>。
<div><button wire:click="showModal">Show modal</button>
<x-jet-dialog-modal wire:model="showingModal">
<x-slot name="title">
{{ __('Delete Account') }}
</x-slot>
<x-slot name="content">
{{ $apt_id }}
</x-slot>
<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('showingModal')" wire:loading.attr="disabled">
{{ __('Nevermind') }}
</x-jet-secondary-button>
<x-jet-danger-button class="ml-2" wire:click="deleteUser()" wire:loading.attr="disabled">
{{ __('Delete Account') }}
</x-jet-danger-button>
</x-slot>
</x-jet-dialog-modal></div>
class Actions extends Component {
public $showingModal = '';
public $apt_id;
public function mount($apt_id)
{
$this->apt_id = $apt_id;
}
public function showModal()
{
$this->showingModal = true;
}
public function render()
{
return view('livewire.dashboard.actions');
}}