tinymce / tinymce-vue

Official TinyMCE Vue component
MIT License
2.06k stars 207 forks source link

Model :value not binding when using <scrip setup> #303

Closed elouanmailly closed 2 months ago

elouanmailly commented 2 years ago

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

exalate-issue-sync[bot] commented 2 years ago

Ref: INT-2795

andysay commented 1 year ago

up

andysay commented 1 year ago

jscasca

maopixin commented 1 year ago

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

websitevirtuoso commented 1 year ago

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

490626721 commented 1 year ago

up,this question not repair!!!

juliandreas commented 11 months ago

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" />
tiny-stale-bot commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.

tiny-stale-bot commented 2 months ago

This issue was closed because it has been stalled for 7 days with no activity.