question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

editor.getValue is not a method

See original GitHub issue

Describe the bug

#807 removed getValue/setValue

while vue-editor still using it

https://github.com/nhn/tui.editor/blob/d50474ea25a67b71897723e875750ab4e75cbe34/apps/vue-editor/src/Editor.vue#L68

and type definition is not updated.

https://github.com/nhn/tui.editor/blob/d50474ea25a67b71897723e875750ab4e75cbe34/apps/editor/index.d.ts#L588

To Reproduce

  1. Try to use vue-editor
  2. Input event never emit

Expected behavior

No code using removed method

Desktop (please complete the following information):

  • OS: Windows 7
  • Browser Chrome 80
  • Version 2.0.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

2reactions
Rorke76753commented, Mar 23, 2020

It’s already documented right here: Instance methods

this.$refs.toastuiEditor.invoke('getHtml');

Anyway the best way to ask these kind of questions it’s to open another issue with the question label 👍

Thank you very much , this help me a lot.

Btw,I have already open an issue before this comment.

1reaction
dsvanidzecommented, Mar 23, 2020

@pepeloper Thank you.

I implemented it in the same way

onChange(event: any) {
  const markdownText = this.invoke('getMarkdown')
  this.$emit(
    'input',
    (typeof this.value === 'undefined' || this.value === null) &&
      markdownText === ''
      ? this.value
      : markdownText,
  )
},
invoke(tuiMethodName: string) {
  return this.$refs.toastuiEditor.invoke(tuiMethodName)
}

However, if v-model does not work, we need to check the case, when value is undefined or null. It will otherwise change undefined and null values to empty string ''

Read more comments on GitHub >

github_iconTop Results From Across the Web

CodeMirror - "Uncaught TypeError: editor.getValue() is not a ...
CodeMirror 2 uses the getValue() method instead, var code = editor.getValue(); //a string with your editor content.
Read more >
getValue seems not working - CodeMirror
My problem is that I'm failing when I try to get the value of the textarea. Here's what I've written so far: var...
Read more >
GetValue Method | ASP.NET Web Forms Controls
Use the GetEditValue method to access the value being edited by an editor. The editor's edited value can be represented by different data...
Read more >
Displaying the Property Value - RAD Studio
The property editor's GetValue method returns a string that represents the current value of the property. The Object Inspector uses this string in...
Read more >
How to get content from the editor and set content | TinyMCE
So here's a brief guide on the relevant TinyMCE API methods, ... to get the content without any HTML tags; Why isn't the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found