Skip to content

Commit 91a5fca

Browse files
authored
fix: crepe vue unmount error (#1818)
1 parent cb0ee40 commit 91a5fca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: packages/crepe/src/core/crepe.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ export class Crepe {
8888
this.#initPromise = Promise.all(promiseList)
8989
}
9090

91-
async create() {
91+
create = async () => {
9292
await this.#initPromise
9393
return this.#editor.create()
9494
}
9595

96-
async destroy() {
96+
destroy = async () => {
9797
await this.#initPromise
9898
return this.#editor.destroy()
9999
}
@@ -102,16 +102,16 @@ export class Crepe {
102102
return this.#editor
103103
}
104104

105-
setReadonly(value: boolean) {
105+
setReadonly = (value: boolean) => {
106106
this.#editable = !value
107107
return this
108108
}
109109

110-
getMarkdown() {
110+
getMarkdown = () => {
111111
return this.#editor.action(getMarkdown())
112112
}
113113

114-
on(fn: (api: ListenerManager) => void) {
114+
on = (fn: (api: ListenerManager) => void) => {
115115
if (this.#editor.status !== EditorStatus.Created) {
116116
this.#editor.config((ctx) => {
117117
const listener = ctx.get(listenerCtx)

0 commit comments

Comments
 (0)