最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

quill - Store Javascript Delta object in database - Stack Overflow

programmeradmin6浏览0评论

im using the Quill text editor which returns a Delta object representing the content.

/

i want to store this in a database but am unable to convert it to a string/json type format

deltaobject.toString

The above returns

[object object]

im using the Quill text editor which returns a Delta object representing the content.

https://quilljs./

i want to store this in a database but am unable to convert it to a string/json type format

deltaobject.toString

The above returns

[object object]
Share Improve this question asked Nov 1, 2017 at 12:50 PowerMan2015PowerMan2015 1,4185 gold badges22 silver badges48 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Use the native JSON converter...

var json = JSON.stringify(deltaobject);

then to convert it back to an object...

var obj = JSON.parse(json);

var json = JSON.stringify({ prop1: "Value1", property2: 123.456 });
console.log(json);

var obj = JSON.parse(json);
console.log(obj);

发布评论

评论列表(0)

  1. 暂无评论