Fix to work without errors in Nuxt Universal (#723)

by @patarapolw 

* allow manual init and destroy for use with Nuxt

* fix onDestroy-related methods

* avoid global scope, and use function scope instead

* add createInstance function to window.REMARK42

* 1. allow DOMNode to be put in remark_config 2. check remark_config before try to attach node

* move createInstance function outside

* update embed.ts

* avoid ?.

* 📚 Docs: doc on how to make it work with SPAs

* 📚 Docs: fix spa.md to be more flexible

*  Feat: add REMARK42::ready event

* remove nuxt-specific terminologies

* tell MutationObserver to disconnect on destroy

* update docs/spa.md
This commit is contained in:
Pacharapol Withayasakpunt
2020-07-31 12:21:00 -05:00
committed by GitHub
parent d1268bbe8c
commit 5d6729ddd5
7 changed files with 197 additions and 77 deletions
+2
View File
@@ -476,6 +476,8 @@ And then add this node in the place where you want to see Remark42 widget:
After that widget will be rendered inside this node.
If you want to set this up on a Single Page App, see [/docs/spa.md](/docs/spa.md).
##### Themes
Right now Remark has two themes: light and dark.