mirror of
https://github.com/ljcoder2015/obsidian-excel.git
synced 2026-07-22 08:30:28 +00:00
feat: excel布局处理
This commit is contained in:
parent
4c0f5d96bc
commit
2c3dd57786
2 changed files with 1071 additions and 1067 deletions
|
|
@ -22,18 +22,23 @@ export class ExcelView extends TextFileView {
|
|||
setViewData(data: string, clear: boolean): void {
|
||||
this.data = data;
|
||||
|
||||
this.containerEl.empty();
|
||||
this.containerEl.createDiv({
|
||||
this.contentEl.empty();
|
||||
this.contentEl.createDiv({
|
||||
attr: {
|
||||
id: "x-spreadsheet"
|
||||
// class: "sheet-box"
|
||||
id: "x-spreadsheet",
|
||||
class: "sheet-box",
|
||||
},
|
||||
});
|
||||
|
||||
console.log(this.ownerWindow, this.data);
|
||||
console.log(this.ownerWindow.document.documentElement.clientWidth);
|
||||
const jsonData = JSON.parse(this.data || "{}") || {}
|
||||
//@ts-ignore
|
||||
this.sheet = new Spreadsheet("#x-spreadsheet")
|
||||
this.sheet = new Spreadsheet("#x-spreadsheet", {
|
||||
view: {
|
||||
height: () => this.contentEl.clientHeight,
|
||||
width: () => this.contentEl.clientWidth,
|
||||
},
|
||||
})
|
||||
.loadData(jsonData) // load data
|
||||
.change(data => {
|
||||
// save data to db
|
||||
|
|
|
|||
2121
styles.css
2121
styles.css
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue