K
K
Konstantin Malyarov2018-04-18 16:14:36
TinyMCE
Konstantin Malyarov, 2018-04-18 16:14:36

How to make tinyNCE work with VueJS without 3rd party libraries?

tinymce.init({
    selector: 'textarea#print'
})

new Vue({
    delimiters: ['{>', '<}'],
    el: '#str4',
    data() {
        return {
            day: null,
            time: null,
            last_name: null,
            first_name: null,
            patronymic: null,
            birthday: null,
            number: null,
            outpatient_card: null,
            department: null,
            ward: null,
            complaints: null,
            anamnesis: null,
            life_story: null,
            general_status: null,
            local_status: null,
            treatment_plan: null,
            appointments: null,
        }
    },
    methods: {
        inputData: function (event, type) {
// тут должен выполняться setContetn для textarea tinyMCE
// tinymce.get('textarea#print').setContent(data);
        }
    },
    created: function () {
        this.day = document.getElementById('id_day').value
        this.time = document.getElementById('id_time').value
        this.last_name = document.getElementById('id_last_name').value
        this.first_name = document.getElementById('id_first_name').value
        this.patronymic = document.getElementById('id_patronymic').value
        this.birthday = document.getElementById('id_birthday').value
        this.number = document.getElementById('id_number').value
        this.outpatient_card = document.getElementById('id_outpatient_card').value
        this.department = document.getElementById('id_department').value
        this.ward = document.getElementById('id_ward').value
        this.complaints = document.getElementById('id_complaints').value
        this.anamnesis = document.getElementById('id_anamnesis').value
        this.life_story = document.getElementById('id_life_story').value
        this.general_status = document.getElementById('id_general_status').value
        this.local_status = document.getElementById('id_local_status').value
        this.treatment_plan = document.getElementById('id_treatment_plan').value
        this.appointments = document.getElementById('id_appointments').value
    }

How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Nagorny, 2018-04-18
@Konstantin18ko

Add plugin code to mounted

mounted: function () {
  this.$nextTick(function () {
    // Код, который будет запущен только после
    // отображения всех представлений
  })
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question