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

Vditor.preview不能渲染 #14

Closed
lhlyu opened this issue Dec 8, 2019 · 1 comment
Closed

Vditor.preview不能渲染 #14

lhlyu opened this issue Dec 8, 2019 · 1 comment
Assignees
Milestone

Comments

@lhlyu
Copy link

lhlyu commented Dec 8, 2019

在vue中我有两个组件使用了Vditor,组件A用的是Vditor.preview,代码如下:

mounted() {
       Vditor.preview(document.getElementById('vditorPreview'),this.html, {
           className: 'preview vditor-reset vditor-reset--anchor',
           hljs: {
           lineNumber: true,
                    enable: true
           },
           speech: {
                enable: true,
           },
           anchor: true
     })
}

打开后报错

 Cannot read property 'options' of undefined

另一个组件B用的是编辑模式,代码如下:

mounted() {
      this.vditor = new Vditor('vditorEdit', {
          height: 600,
          tab: '\t',
          preview:{
                delay: 200,
          }
      })
}

现在的问题是打开A会报上面的错误,然后我再打开B是正常的,再回去打开A又不报错了,如果再次刷新,还是报错

@Vanessa219 Vanessa219 self-assigned this Dec 9, 2019
@Vanessa219 Vanessa219 added this to the 1.10 milestone Dec 9, 2019
@Vanessa219
Copy link
Owner

请更新到 1.10.7 再试一下

Vanessa219 added a commit that referenced this issue Dec 9, 2019
Vanessa219 added a commit that referenced this issue Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants