saveButton.addEventListener('click',()=>{
editor.save()
.then((savedData)=>{
})
我正在尝试让单击按钮将数据提交到数据库。
数据库架构声明:
content: [
{
id: {
type: String,
},
type: {
type: String,
required: true,
},
data: {
type: mongoose.Schema.Types.Mixed,
required: true,
},
},
// { _id: false },
],
服务器:
content: JSON.parse(content)
客户:
const contentJSON = JSON.stringify(editorContent.blocks);
formData.append('content', contentJSON);
这对我有用