整合困难 "tui-editor-1.0.3"
Difficulties in integrating "tui-editor-1.0.3"
我在将“tui-editor-1.0.3”集成到网页时遇到困难。
它抛出一个错误:"Uncaught TypeError: Cannot read property 'scrollIntoView' of undefined"
错误源在 tui-Editor-editor.js
的行号 19122
,this._currentButton
中存在 null
值,它试图访问 this._currentButton.scrollIntoView()
.
我试图在访问 this._currentButton.scrollIntoView
之前检查 null
值,但它没有生成适当的编辑器视图。
如何确保 this._currentButton
始终不可为空?或者,任何其他解决方案?
我今天遇到了同样的问题。
我对尝试 TUI 编辑器还很陌生,所以我不确定正确的解决方案是什么。但根据阅读代码,指定 codeBlockLanguages
选项可能会避免此错误。
var editor = new tui.Editor({
el: document.querySelector('#editor'),
initialEditType: 'markdown',
previewStyle: 'vertical',
height: '300px',
codeBlockLanguages: ['ruby', 'PHP', 'javascript'],
});
我在将“tui-editor-1.0.3”集成到网页时遇到困难。
它抛出一个错误:"Uncaught TypeError: Cannot read property 'scrollIntoView' of undefined"
错误源在 tui-Editor-editor.js
的行号 19122
,this._currentButton
中存在 null
值,它试图访问 this._currentButton.scrollIntoView()
.
我试图在访问 this._currentButton.scrollIntoView
之前检查 null
值,但它没有生成适当的编辑器视图。
如何确保 this._currentButton
始终不可为空?或者,任何其他解决方案?
我今天遇到了同样的问题。
我对尝试 TUI 编辑器还很陌生,所以我不确定正确的解决方案是什么。但根据阅读代码,指定 codeBlockLanguages
选项可能会避免此错误。
var editor = new tui.Editor({
el: document.querySelector('#editor'),
initialEditType: 'markdown',
previewStyle: 'vertical',
height: '300px',
codeBlockLanguages: ['ruby', 'PHP', 'javascript'],
});