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

[Bug Report] 调用cherryInstance.setValue方法的时候,进入页面出现异常 #753

Open
3 tasks
cmk2003 opened this issue Apr 26, 2024 · 0 comments
Open
3 tasks
Labels
bug Something isn't working

Comments

@cmk2003
Copy link

cmk2003 commented Apr 26, 2024

Prerequisites

Describe the Bug

我想实现编辑文章的功能,点击编辑的时候会跳转到编辑页面,显示文章信息,编辑页面采用的是cherry这个
最开始的调用如下: 用的是ref

    <div>
      <!-- 编辑器-->
      <cherry-components ref="cherryComponents"
                         :height="height"
                         :editorModel="editorModel"
      ></cherry-components>
    </div>

this.$refs.cherryComponents.cherryInstance.setValue('');

看到有老哥说是ref的问题,然后我就用数据总线mitt,结果还是不行

A:
 EventBus.emit("set-content", res.data.data.content);

B:
 mounted() {
    this.initMarkDown();
    EventBus.on("set-content", (content) => {
      this.content = content;
      this.cherryInstance.setValue(content);
    });
  },

这样还是会有问题,是我的调用方法不对吗
项目参考:https://gitee.com/HelloWangXianLin/xiaoxiao-demo/tree/master/SpringBoot+Layui+Vue%20%E7%BC%96%E8%BE%91%E5%99%A8/easy-editor-ui

Reproduction Steps

No response

System Information

No response

Contributing

None

@cmk2003 cmk2003 added the bug Something isn't working label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant