React 中 Sun 编辑器中的默认值
P粉438918323
P粉438918323 2023-09-08 10:47:07
0
1
500

我想为 Sun 编辑器设置默认值。

我从数据库获取的默认值

我像这样设置了默认值,但它不起作用。

<SunEditor
     autoFocus={true}
     onChange={handleEditorChange}
     setOptions={toolbarOptions}
     defaultValue={guide.description}
/>

数据库中的数据 在此输入图像描述

只有这样才有效

<SunEditor
     autoFocus={true}
     onChange={handleEditorChange}
     setOptions={toolbarOptions}
     defaultValue={"<p>The editor's default value</p>"}
/>

P粉438918323
P粉438918323

全部回复(1)
P粉885035114

尝试react-sun-editor的api函数

<SunEditor
     autoFocus={true}
     onChange={handleEditorChange}
     setOptions={toolbarOptions}
     setContents={guide.description}
/>

Suneditor-react 自述文件链接

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!