gitment icon indicating copy to clipboard operation
gitment copied to clipboard

vue下不能使用,会报错

Open maixiaojie opened this issue 7 years ago • 4 comments

build.js:34436 [mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[Autorun@2] TypeError: Cannot read property 'firstChild' of null

maixiaojie avatar Feb 06 '18 09:02 maixiaojie

同样我也遇到了这个问题

ifredom avatar Apr 20 '18 07:04 ifredom

应该是没有创建相应的空div 如果使用的是以下方法 gitment.render('comments') 那就在使用之前在dom中插入以下元素(拥有相应id的空div) <div id="comments"></div>

CoderNie avatar May 18 '18 03:05 CoderNie

这样不行?

<div ref="comments"></div>


//...
gitment.render(this.$refs.comments);

hipi avatar May 28 '18 14:05 hipi

我直接在 mounted 里初始化是可以的

nekoleamo avatar Aug 15 '18 15:08 nekoleamo