Closed BenjaminHoegh closed 2 years ago
Hey Benjamin, no there is no repo with an demo. But you could show me how you tried to implement it, so that I am able to help you.
Well right now it just a clean install of Laravel, Livewire and AlpineJS.
then I inserted the code you provided:
<html>
<head>
@livewireStyles
</head>
<body>
@livewire('editorjs', [
'editorId' => "myEditor",
'value' => $value,
'uploadDisk' => 'public',
'downloadDisk' => 'public',
'class' => '...',
'style' => '...',
'readOnly' => true,
'placeholder' => 'Lorem ipsum dolor sit amet'
])
@livewireScripts
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.2/dist/alpine.min.js"></script>
</body>
</html>
Then i'm getting Undefined variable $value
That's probably because you don't provide a value. Ff you don't pass a value to the view that can not work. Also I don't see the inclusion of the provided scripts using "@livewireEditorjsScripts".
Please refer to the installation instructions of the readme.
Okay so now it works. how do I get it to save the data from it when pressing a button?
The Editor syncs its state to the server when the content changes. It emits a livewire event with the state. Please refer to the docs: https://github.com/maxeckel/livewire-editorjs#events--saving-state
Do you have a repo where you have set up a full working example? I may just be stupid but I don't quite get how to make it work