I use the vue wrapper of editor in my application.
I have try
console.log(this.$refs.editor.getHtml);
But every time the console prints "undefined".
How can I get the content in the editor correctly?
@Rorke76753 What you called above is to check the existence of the method, so the usage is wrong. When getting the value entered in the current editor, the following instance method should be called.
<template>
<div>
<button v-on:click="getMarkdown">getMarkdown</button>
<button v-on:click="getHtml">getHtml</button>
<editor ref="toastuiEditor" />
</div>
</template>
<script>
import 'codemirror/lib/codemirror.css';
import '@toast-ui/editor/dist/toastui-editor.css';
import { Editor } from '@toast-ui/vue-editor';
export default {
components: {
editor: Editor
},
methods: {
getMarkdown() {
let markdown = this.$refs.toastuiEditor.invoke('getMarkdown');
console.log(markdown);
},
getHtml() {
let html = this.$refs.toastuiEditor.invoke('getHtml');
console.log(html);
}
}
};
</script>

@Rorke76753 What you called above is to check the existence of the method, so the usage is wrong. When getting the value entered in the current editor, the following instance method should be called.
<template> <div> <button v-on:click="getMarkdown">getMarkdown</button> <button v-on:click="getHtml">getHtml</button> <editor ref="toastuiEditor" /> </div> </template> <script> import 'codemirror/lib/codemirror.css'; import '@toast-ui/editor/dist/toastui-editor.css'; import { Editor } from '@toast-ui/vue-editor'; export default { components: { editor: Editor }, methods: { getMarkdown() { let markdown = this.$refs.toastuiEditor.invoke('getMarkdown'); console.log(markdown); }, getHtml() { let html = this.$refs.toastuiEditor.invoke('getHtml'); console.log(html); } } }; </script>
Thank you , this help me a lot.

why i get no content but a empty string
Is there such a way to get content? I remember I didn't do it that way
editor.getMarkdown()
https://github.com/jackworkshop/WP-ReliableMD/blob/master/js/WPReliableMD_Admin.js#L240-L250
Most helpful comment
@Rorke76753 What you called above is to check the existence of the method, so the usage is wrong. When getting the value entered in the current editor, the following instance method should be called.