Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vditor.destroy 报错 #1219

Closed
de1ck opened this issue Apr 28, 2022 · 0 comments
Closed

vditor.destroy 报错 #1219

de1ck opened this issue Apr 28, 2022 · 0 comments
Assignees
Milestone

Comments

@de1ck
Copy link

de1ck commented Apr 28, 2022

https://github.com/Vanessa219/vditor/blob/master/src/index.ts#L330-L331

TypeError: Cannot read properties of null (reading 'remove')

=> document.getElementById("vditorIconScript"). remove()

public destroy() {
        this.vditor.element.innerHTML = this.vditor.originalInnerHTML;
        this.vditor.element.classList.remove("vditor");
        this.vditor.element.removeAttribute("style");
        document.getElementById("vditorIconScript").remove();
        this.clearCache();

        UIUnbindListener();
        this.vditor.wysiwyg.unbindListener();
    }
@Vanessa219 Vanessa219 self-assigned this May 6, 2022
@Vanessa219 Vanessa219 added this to the 3.8 milestone May 6, 2022
@Vanessa219 Vanessa219 changed the title vditor.destroy: TypeError: Cannot read properties of null (reading 'remove') vditor.destroy 报错 May 6, 2022
Vanessa219 added a commit that referenced this issue May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants