Hello,
I wanted to make an extension in the editor plugin where I can link pages.
My approach was to pass a selection of pages to Vue and then to use the props. Unfortunately I don’t get to feel the props.
Does anyone have an idea?
Vue:
icon: "share",
// get the block content
props: {
content: String,
attrs: [Array, Object]
},
data() {
return {
pages: this.attrs.pages || [{ value: '-a-', text: '-A-' }],
content: this.content || ''
}
},
PHP:
Kirby::plugin('dummy/editor-share-block', [
'snippets' => [
'editor/share' => __DIR__ . '/snippets/share.php'
],
'props' => function() {
return [
['value' => 'dummy1', 'text' => 'Dummy1'],
['value' => 'dummy2', 'text' => 'Dummy2']
];
}
]);