Uploading content
This commit is contained in:
28
app/Livewire/Test/ChildComponent.php
Normal file
28
app/Livewire/Test/ChildComponent.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Test;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class ChildComponent extends Component
|
||||
{
|
||||
|
||||
public $id = 0;
|
||||
|
||||
public function mount($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.test.child-component');
|
||||
}
|
||||
|
||||
|
||||
public function doSome()
|
||||
{
|
||||
$this->dispatch('did');
|
||||
}
|
||||
}
|
||||
21
app/Livewire/Test/ParentComponent.php
Normal file
21
app/Livewire/Test/ParentComponent.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Test;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class ParentComponent extends Component
|
||||
{
|
||||
public int $count = 0;
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.test.parent-component')
|
||||
->extends('components.layouts.app')
|
||||
->section('content');
|
||||
}
|
||||
|
||||
public function counting()
|
||||
{
|
||||
$this->count++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user