attoae / quill-table-better

A module that enhances the table functionality of Quill.
MIT License
59 stars 5 forks source link

qlEditor.setContents(data) does not work properly #28

Closed Libpzzz closed 1 month ago

Libpzzz commented 2 months ago

The data I obtained using qlEditor.getContents() was added to qlEditor.setContents(data) in quill again; I found that it could not be displayed normally let data = { ops: [ { attributes: { "table-temporary": { "data-class": "ql-table-better" } }, insert: "\n", }, { insert: "1" }, { attributes: { "table-cell-block": "cell-hj8r", "table-cell": { "data-row": "row-9j0t", width: "72" }, }, insert: "\n", }, { insert: "2" }, { attributes: { "table-cell-block": "cell-xfdr", "table-cell": { "data-row": "row-9j0t", width: "72" }, }, insert: "\n", }, { insert: "3" }, { attributes: { "table-cell-block": "cell-eg8u", "table-cell": { "data-row": "row-qn7p", width: "72" }, }, insert: "\n", }, { insert: "4" }, { attributes: { "table-cell-block": "cell-9p58", "table-cell": { "data-row": "row-qn7p", width: "72" }, }, insert: "\n", }, ], } The data returned using qlEditor.setContents(data) is these {"ops":[{"attributes":{"table-temporary":{"data-class":"ql-table-better"}},"insert":"\n"}]}

attoae commented 2 months ago

12