tinymce-vue icon indicating copy to clipboard operation
tinymce-vue copied to clipboard

Model :value not binding when using <scrip setup>

Open elouanmailly opened this issue 3 years ago • 7 comments

What is the current behavior?

After initializing a component with the <script setup> syntax, it seems that the value binding does not work.

https://codesandbox.io/s/tinymce-editor-script-setup-x4dvkp

What is the expected behavior?

The initial value in the editor should be "initial-content" and when the button is clicked, the value should change to "Change value with button"

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

Vue: 3.2.31 Vite: 2.8.6 @tinymce/tinymce-vue: 4.0.6 tinymce: 6.0.0

elouanmailly avatar Mar 10 '22 16:03 elouanmailly

Ref: INT-2795

exalate-issue-sync[bot] avatar Mar 10 '22 16:03 exalate-issue-sync[bot]

up

andysay avatar Dec 06 '22 04:12 andysay

jscasca

andysay avatar Dec 06 '22 05:12 andysay

I have same question,I can't imagine such a simple problem happening

maopixin avatar Apr 19 '23 01:04 maopixin

This is because in vue3 we have model-value. not "value"

websitevirtuoso avatar Jun 16 '23 07:06 websitevirtuoso

up,this question not repair!!!

490626721 avatar Jul 27 '23 17:07 490626721

This is my setup, hope it helps:

const tinyConfig = {
  // Your setup here
  skin: false,
  plugins: "lists link image table code help wordcount",
  content_css: false,
  branding: false,
  promotion: false,

  // The important part
  setup(editor) {
    editor.on("input", () => handleInput(editor.getContent()));
  },
};

const handleInput = (editor) => {
  // Do whatever you want here
  console.log(editor);
};
<Editor :init="tinyConfig" />

juliandreas avatar Oct 13 '23 13:10 juliandreas