dream-num / univer

Univer is an Isomorphic Full-Stack Framework for Creating and Editing Spreadsheets, Docs, and Slides Across Web and Server
https://univer.ai
Apache License 2.0
7.14k stars 629 forks source link

[Bug] How to save cells styles as an object instead of a id string? #4094

Closed lily7630 closed 1 hour ago

lily7630 commented 2 hours ago

在您提交此问题之前,您是否检查了以下内容?

受影响的包和版本

^0.4.2

复现链接

5566

预期行为

我希望通过univerAPI.getActiveWorkbook().save() 保存表格数据时,单元格的样式是对象,像这样 "s":{"ht":2,"bl":1},现在保存时单元格对象是id,像这样的 "s": "样式id"

实际行为

单元格样式是id字符串

运行环境

Chrome

系统信息

No response

univer-bot[bot] commented 2 hours ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

Origin Title: [Bug] How to save cells styles as an object instead of a id string?

Title: [Bug] How to save cells styles as an object instead of a id string?


Before you submitted this question, did you check the following?

Affected packages and versions

^0.4.2

Recurrence link

5566

Expected behavior

I hope that when saving table data through universalAPI.getActiveWorkbook().save(), the style of the cell is an object, like this "s":{"ht":2,"bl":1}, and now when saving, the cell object is the id, like this "s": "style id"

Actual behavior

The cell style is the id string

Running environment

Chrome

System information

No response

jikkai commented 1 hour ago

The id is designed as the index of the style object. If you need to save it as the style object itself, you'll need to handle that yourself and be responsible for any resulting bugs.