imsun / gitment

A comment system based on GitHub Issues.
https://imsun.github.io/gitment/
MIT License
4.06k stars 348 forks source link

建议为文档添加创建container容器的说明 #30

Open zoubingwu opened 7 years ago

zoubingwu commented 7 years ago

在引入js和css后,按照文档执行如下代码报错:

gitment.render('comments')

抛出mobx error,targetContainer为null所以找不到它的firstChild,粗略看了下源码发现似乎没有完成js创建容器的步骤。

其实demo页面的代码有,不过大部分人一开始就是从文档看起,所以还是建议文档中添加一句说明,需要在html中加入容器:

<!-- the id in render function -->
<div id="comments"></div>