Konstantin18ko
@Konstantin18ko
Стоматолог

Как заставить работать tinyNCE с VueJS без сторонних библиотек?

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
    }


Как это реализовать?
  • Вопрос задан
  • 92 просмотра
Решения вопроса 1
Добавить код плагина в mounted

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

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы