This is a very basic TinyMCE component. It uses 'entangle'. This allows you to link a Livewire and Alpine property to eachother. If one value changes, the other does too.
Add tinymce.blade.php
to views/components/input
. This can be another
component folder too if you prefer, but keep in mind that you should also
change the x-input.tinymce
structure accordingly.
Make sure you have added the TinyMCE library in the layout that you're extending. Although with some extra work the component should be able to do this for you, it doesn't right now.
After the TinyMCE library has been added, this is how you use it:
<x-input.tinymce wire:model="editor" placeholder="Type anything you want..." />
Note that all HTML attributes will propogate to the text area. In this case the placeholder will automatically be passed on to the input in the blade component.
In the example we link it to editor
. This can be any wired property in the
Livewire component.
Thankyou!