Refactored how event was triggered
This commit is contained in:
@@ -18,6 +18,17 @@ class LivewireTreeMapChart extends Component
|
||||
$this->treeMapChartModel = $treeMapChartModel->toArray();
|
||||
}
|
||||
|
||||
public function onBlockClick($block)
|
||||
{
|
||||
$onBlockClickEventName = data_get($this->treeMapChartModel, 'onBlockClickEventName');
|
||||
|
||||
if ($onBlockClickEventName === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->dispatch($onBlockClickEventName, $block);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire-charts::livewire-tree-map-chart');
|
||||
|
||||
Reference in New Issue
Block a user