How can I make javascript access to php variable
in Component
public $content ;
in component view
<script src="https://cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
<div wire:ignore class="col-sm-10">
<textarea class="w-full "
wire:ignore
wire:model.debounce.999999s="content" id="content"> </textarea>
</div>
<script>
CKEDITOR.replace('content').on('change', function(e){
@this.set('content', e.editor.getData());
});
</script>
it works good.
but I want array for form .
The following is not working .
I guess @this.set can not access array variable.
in Component
public $form = [
'content'=> null,
];
in view .
<script src="https://cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
<div wire:ignore class="col-sm-10">
<textarea class="w-full "
wire:ignore
wire:model.debounce.999999s="form.content" id="content"> </textarea>
</div>
<script>
CKEDITOR.replace('content').on('change', function(e){
@this.set('form.content', e.editor.getData());
});
</script>
How can I use @this.set(‘form.content’, ) … ?