Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Livewire/Blade组件中的渲染变量_Php_Laravel_Laravel Blade_Laravel Livewire - Fatal编程技术网

Php Livewire/Blade组件中的渲染变量

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

我有一个包含多个模态的表,我正在尝试测试在循环中传递行id,以确保我的模态正常工作。但是我无法通过Livewire组件获取要显示的变量值

Livewire组件

<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');
}}