Hi,
I’ve created a very basic stats plugin for my site. Now I’m trying to display the collected data inside a Panel area. I don’t want to have to create a custom Vue component, while there’s a great collection of built-in components. So far, I’ve managed to add a link to the left sidebar which opens a panel area, like this:
<?php
Kirby::plugin('chch/dumbstats', [
'areas' => [
'dumbstats' => function () {
return [
'label' => 'Dumb Stats',
'icon' => 'chart',
'menu' => true,
'views' => [
[
'pattern' => 'dumbstats',
'action' => function () {
$columns = [];
$rows = [];
// ...more logic here...
return [
'component' => 'k-table',
'props' => [
'columns' => $columns,
'rows' => $rows
]
];
}
]
]
];
}
]
]);
All works fine, only my k-table component opens on an empty page, not inside of the Panel area, which is what I would like. I’ve been trying to figure out how to use the available components to achieve that, but no luck yet.
With k-panel-inside I’ve managed to get the Panel layout to show, but empty.
return [
'component' => 'k-panel-inside',
'slots' => [
'default' => [
[
'component' => 'k-table',
'props' => [
'columns' => $columns,
'rows' => $rows
]
]
]
]
];
Anyone knows what’s the correct syntax to add my components to the Panel area?
Cheers!

