How to get editor instance in vue? #1673
X-X-X-X-X-X-X-X-X-X-X-X-X
started this conversation in
General
Replies: 2 comments
-
I have found a solution, but I am more curious about why the above approach is not feasible import { getMarkdown } from "@milkdown/kit/utils";
let editor = useEditor(
//...
)
// Use this method after loading is complete
editor.get()?.action(getMarkdown()) |
Beta Was this translation helpful? Give feedback.
0 replies
-
You'll need the editor to be created before getting the instance. You can use const crepe = new Crepe({
root,
defaultValue: "# 1325321532",
});
crepe.on(listener => {
listener.mounted(() => {
editor.value = crepe;
});
}); But it's not recommended. You should use the return value of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Initial checklist
Affected packages and versions
7.6.2
Link to runnable example
No response
Steps to reproduce
Expected behavior
How can I use the getMarkdown() method correctly?
Actual behavior
editor.value?.getMarkdown()
The error was promptedRuntime
No response
OS
No response
Build and bundle tools
No response
Beta Was this translation helpful? Give feedback.
All reactions