tinymce / tinymce-vue

Official TinyMCE Vue component
MIT License
2.08k stars 208 forks source link

How to change tinymce language dynamically? #391

Closed snowdream closed 1 year ago

snowdream commented 1 year ago

What is the current behavior? I can not change change tinymce language dynamically.

Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar.

What is the expected behavior? change tinymce language dynamically

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-vue?

TinyITAdmin commented 1 year ago

Ref: INT-3232

snowdream commented 1 year ago

Fix: change language with rerender.

<template>
  <editor
    ref="editorRef"
    v-model="tinycontent"
    tinymce-script-src="/tinymce/tinymce.min.js"
    :init="tinyinit"
  />
</template>

<script setup lang="ts">
import Editor from '@tinymce/tinymce-vue'
...
const editorRef = ref()
editorRef.value.rerender({ language: language.value })
...

Reference

Refreshable.vue