Documentation

Vue JS

Redactor X has Vue Component you can see how it works and download from GitHub.

One Way Binding

Import

import '/your-dist-path/redactorx.min.js';
import './vue-redactorx.js';

Component

<div id="app">
    <RedactorX v-model="content" :config="configOptions"></RedactorX>
    {{ content }}
</div>

App

new Vue({
    el: '#app',
    data() {
        return {
            content: '<h1>Hello and welcome</h1>',
            configOptions: {}
        }
    }
});

Two Way Binding

Import

import '/your-dist-path/redactorx.min.js';
import './vue-redactorx.js';

Component

<div id="app">
    <RedactorX v-model="content" :config="configOptions"></RedactorX>
    <textarea v-model="content"></textarea>
</div>

App

new Vue({
    el: '#app',
    data() {
        return {
            content: '<h1>Hello and welcome</h1>',
            configOptions: {}
        }
    }
});

Call with options

new Vue({
    el: '#app',
    data() {
        return {
            content: '<h1>Hello and welcome</h1>',
            configOptions: {
                plugins: ['blockcode'],
                editor: {
                    focus: true
                }
            }
        }
    }
});

Call with events

new Vue({
    el: '#app',
    data() {
        return {
            content: '<h1>Hello and welcome</h1>',
            configOptions: {
                subscribe: {
                    'app.start': function() {
                        console.log('Redactor X started!');
                    }
                }
            }
        }
    }
});