tinymce / tinymce-vue

Official TinyMCE Vue component
MIT License
2.01k stars 202 forks source link

How to change tinymce language dynamically? #391

Closed snowdream closed 9 months ago

snowdream commented 9 months 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 9 months ago

Ref: INT-3232

snowdream commented 9 months 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