react-rte工具栏Config = {[]}和showToolbar = {false}

问题描述 投票:0回答:1

我正在尝试从react-rte删除​​工具栏,所以我尝试了

        toolbarConfig={[]},
        showToolbar={false}

我只想显示一些html,仅此而已。

但是它给了我这个:

enter image description here

如何删除react-rte中的工具栏?

codesandbox.io

reactjs rte
1个回答
0
投票

似乎没有showToolbar这样的选项。您可以将readOnly选项设置为true,这将阻止工具栏的渲染(请参见RichtTextEditor.js:122。)。检查this Codesandbox,请注意,我使用createValueFromString(...)Source)进行状态初始化(要求标记为string和format选项(string))。您可以调整标记的格式,我已将html用于沙箱(请参阅可用的所有可用选项here)。此外,可以随时删除toolbarConfig参数,不需要。

© www.soinside.com 2019 - 2024. All rights reserved.