dimanche 24 novembre 2019

Laravel 5: Display the value of my ckeditor textarea in my edit using vue js

This is my first time to apply the vue js in laravel to our project. One of my field in my add / edit is called description and it is a textarea. We implemented the ckeditor in our textarea, now I have a problem in displaying it in my edit component.

App.js

Here in my App.js we applied the ckeditor

ClassicEditor
        .create( document.querySelector( '#edit-description' ), {
            toolbar: [ 'heading', '|', 'bold', 'italic', 'link', '|', 'bulletedList', 'numberedList', '|', 'undo', 'redo' ]
        } )
        .then( editor => {
        theEditEditor = editor; // Save for later use.
    } );

Edit.vue

<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="form-group">
            <label>Description</label>
            <textarea class="form-control" name="edit_description" id="edit-description"></textarea>
        </div>
    </div>
</div>

EXAMPLE

My List

enter image description here

View

// After I clicked the button in the action column, modal will show

enter image description here

Edit

// When I clicked the edit in the button right corner

enter image description here

NOTE: I also tried the v-html & v-bind:value but it didn't work.

Question: How do I display the value of my ckeditor(description) in my display component?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire