Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

路由切换或者重载的时候会报错误 #20

Open
ice-musru opened this issue Dec 14, 2020 · 3 comments
Open

路由切换或者重载的时候会报错误 #20

ice-musru opened this issue Dec 14, 2020 · 3 comments

Comments

@ice-musru
Copy link

发现当切换了路由,或者本地开发热重载之后
会报:

beforeMount hook: "TypeError: Cannot read property 'scroll' of undefined"
TypeError: Cannot read property 'scroll' of undefined

@lpreterite
Copy link
Owner

@hasasa 单看错误我无法定位到问题,可以在codepin平台或是类似线上平台上复现一下例子吗?

@ice-musru
Copy link
Author

这个错误我看了应该不是你这个封装的问题,而是编辑器本身的问题。

@quanxy
Copy link

quanxy commented Jan 14, 2021

试着将 beforeMount 中的代码移到 mounted 中:

mounted () {
  // beforeMount code
  // ...

  this.$nextTick(() => {
    this.editor.targetElm = this.$el;
    this.editor.render()
  })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants