CKEditor 5 - 添加后自动接受建议

问题描述

就我而言,我想跟踪编辑器上的所有更改,除了检查 TodoList 插件。我们尝试在 addSuggestion 上自动接受它。但是我们遇到了错误。 \

addSuggestion: (suggestionData) => {
    console.log("Suggestion added",suggestionData);

    props.setSuggestions({
      ...suggestionData,authorId:
        props.user.role === "admin" ? "Metarail" : user.id.toString(),});

    if (suggestionData.data.commandName === "checkTodoList") {
      const suggestion = trackChangesPlugin.getSuggestion(
        suggestionData.id
      );

      console.log(suggestion.accept);
    }

    // Write a request to your database here.
    // The returned `Promise` should be resolved when the request
    // has finished. When the promise resolves with the suggestion data
    // object,it will update the editor suggestion using the provided data.
    return Promise.resolve({
      createdAt: new Date(),// Should be set on the server side.
    });
  },

这是我在 trackChangesPlugin.adapter 上的代码

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)