feat: add react demo for cherry-markdown #821
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
创建了一个在React.js中使用cherry-markdown的demo,支持通过两个下拉菜单切换API和对应的函数的例子,并在Markdown中显示了对应的在React的
App.js
中使用该函数的方法,使用eval允许用户运行输入框里的可编辑代码,上方也放了三个跳转至其它文档的链接,对于部分的描述和代码示例也有修改问题
cherry.is_destroy()
这样的api?不能用null判断的话需要新增一个辅助状态变量最好以UMD形式引入框架,用一个XXX.html文件完成demo
,但我认为如果还是写个类似api.html的话不太必要,而且React使用者一般是使用脚手架创建的那一套项目吧,所以在examples/cherry-markdown-react-demo
下起了一个React工程项目
。如果一定要改成UMD
的话也是可以的Related issues
#797