I’m following the instructions for single file components: https://getkirby.com/docs/reference/plugins/extensions/blocks#single-file-components
At the moment everything (blueprint, snippet) works except the preview, I’m getting the bolt icon and ‘Button’. I’m unsure about the directory structure according the reference index.js
lives here:
/site/plugins/button/index.js
But parcel creates an index.js
in that place.
My structure:
plugins/button:
index.js (parcel generated file)
index.php
blueprints/button.yml
snippets/button.php
src:
index.js
components/Button.vue
plugins/button/src/index.js:
import Button from "./components/Button.vue";
panel.plugin("working-title/button-block", {
blocks: Button
});
plugins/button/index.php:
<?php
Kirby::plugin('working-title/button-block', [
'blueprints' => [
'blocks/button' => __DIR__ . '/blueprints/button.yml'
],
'snippets' => [
'blocks/button' => __DIR__ . '/snippets/button.php'
]
]);
My first try at this, so not sure how to proceed, any ideas?
cheers