quill do do do noce of text-change'
this.editor.on('text-change', function (delta, oldDelta, source) {
...someCode
if(some condition) {
const range = this.editor.getSelection()}}
但是我可以看到这个错误无法读取未定义的属性(读取'getSelection')
this.editor等于 quill ,我可以使用它而不是quill,它在其他功能中起作用
this.editor.on('text-change', function (delta, oldDelta, source) {
...someCode
if(some condition) {
const range = this.editor.getSelection()}}
but i can see this error Cannot read properties of undefined (reading 'getSelection')
this.editor equals quill and i can use this instead of quill, it's worked in other function
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为范围,如果您提前声明变量并将编辑器放在那里,一切都很好
it was because of the scope, if you declare a variable in advance and put the editor there, everything is fine