Migrate From Luckysheet to Univer
Compared with Luckysheet, our newly designed Univer has made great improvements in terms of architecture, data structure and API, so Luckysheet can no longer be migrated 1:1 to Univer.
However, basic data types or APIs can be found in Univer. In view of this, if you still want to migrate Luckysheet data to Univer, you can do some targeted adaptation work according to your needs.
Here is a migration guide for everyone.
Analysis
Configuration
The core work of the conversion is to adapt the workbook configuration, worksheet configuration and cell information. You can refer to the Univer interface and Luckysheet data structure.
Univer | Luckysheet | |
---|---|---|
Workbook configuration | IWorkbookData | Overall Configuration (opens in a new tab) |
Worksheet configuration | IWorksheetData | Sheet Configuration (opens in a new tab) |
Cell | ICellData | Cell Attributes (opens in a new tab) |
Plugin
Luckysheet is initialized through a JSON configuration, while Univer is split, the enhanced functions are implemented with plugins, so some functions need to be dispersed into plugin configurations, such as
Univer | Luckysheet | |
---|---|---|
Number Format | numfmt, Configure via Cell Style | Cell format: cell.ct (opens in a new tab) |
Floating Images | floating images | image (opens in a new tab) |
Find & Replace | find replace | - |
Filter | filter | filter (opens in a new tab) |
Sort | sort | filter (opens in a new tab) (Included in filter) |
Pivot Table | pivot table | pivotTable (opens in a new tab) |
Data Validation | data validation | dataverification (opens in a new tab) |
Conditional Formatting | conditional formatting | luckysheet_conditionformat_save (opens in a new tab) |
Comment / Annotation | thread comment | Cell Comments: cell.ps (opens in a new tab) |
Print plugin (opens in a new tab) | ||
Import & Export | import export | Luckyexcel import (opens in a new tab) & export (opens in a new tab), Or community solutions (opens in a new tab) |
Collaborative Editing | collaboration | LuckysheetServer (opens in a new tab) |
API
For the API part, Luckysheet API is uniformly mounted on window.luckysheet
, there are two ways to use Univer API
- Call the encapsulated Facade API
- Use Univer's dependency injection system to inject the plugin's service capabilities into the current Class. Refer to our Plugin Tutorial to easily access the Univer dependency injection system
Summary
For some commonly used basic data, you can refer to Migrate Luckysheet Demo and customize it according to project requirements.
If Univer's existing functions do not meet your needs, you can also develop your own plugin for adaptation.
FAQ
How to migrate the transformExcelTolucky
method of Luckyexcel?
The transformExcelTolucky
method is provided in Luckyexcel, which can convert Excel files into JSON data. In the corresponding Univer, the importXLSXToSnapshot
method of Facade API can be used to achieve this.
If you need to convert an online Excel file, Luckyexcel provides the transformExcelToLuckyByUrl
method. Univer does not directly provide a method to convert online Excel files, but you can download the online Excel file to the local computer through the browser's fetch API, and then call the importXLSXToSnapshot
method to achieve this. Refer to How to Open or Edit an Excel File from a URL.