我试图让一个简单的受控组件输出一个 html 字符串并接收一个 html 字符串。
不幸的是,atlaskit 团队关闭了 repo 中的问题。我在谷歌上看到了这个链接,但实际上在 bitbucket 上看不到它(叹气):https ://bitbucket.org/atlassian/atlaskit-mk-2/issues/89/way-to-get-html-as-它在 atlaskit 中
有其他人尝试过吗?似乎没有任何文档被更新。defaultValue 字段,当给定一个字符串时,会吐出“无效的 json”。
https://atlaskit.atlassian.com/packages/editor/editor-core
import { EditorContext, WithEditorActions } from '@atlaskit/editor-core';
import { CollapsibleEditor } from 'previous-example';
<EditorContext>
<div>
<CollapsibleEditor />
<WithEditorActions
render={actions => (
<ButtonGroup>
<Button onClick={() => actions.clear()}>Clear Editor</Button>
<Button onClick={() => actions.focus()}>Focus Editor</Button>
</ButtonGroup>
)}
/>
</div>
</EditorContext>;
上面的例子不起作用,任何应该为编辑器准备好值的“转换器”也不起作用。
https://atlaskit.atlassian.com/packages/editor/editor-json-transformer
从我收集到的一点点看来,这似乎需要一个
这很糟糕,因为编辑器很漂亮,而且所有其他方面似乎都运行良好,我只是无法在其中获得该死的默认值,这使得它很难用作编辑值的输入。
我理解为什么 atlaskit 团队关闭了问题(至少可以说,这些天的程序员是忘恩负义的)。希望有人可以在这里帮助我!
进一步阅读: - 我认为它使用prosemirror:https ://discuss.prosemirror.net/t/how-to-create-a-mention-plugin-similar-to-atlaskit-supporting-popup/1439