mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
be1b34a163
commit
9143bb8a2f
2 changed files with 15 additions and 2 deletions
|
|
@ -48,7 +48,19 @@ export const avRender = (element: Element, cb?: () => void) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
|
<div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
|
||||||
row.cells.forEach((cell, index) => {
|
row.cells.forEach((cell, index) => {
|
||||||
tableHTML += `<div class="av__cell" ${index === 0 ? 'data-block-id="' + (cell.renderValue?.id || "") + '"' : ""} data-id="${cell.id}" data-index="${index}" style="width: ${data.columns[index].width || 200}px;${cell.bgColor ? `background-color:${cell.bgColor};` : ""}${cell.color ? `color:${cell.color};` : ""}">${cell.renderValue?.content || ""}</div>`;
|
let text: string
|
||||||
|
if (cell.valueType === "text") {
|
||||||
|
text = cell.renderValue as string || ""
|
||||||
|
} else if (cell.valueType === "block") {
|
||||||
|
text = (cell.renderValue as {
|
||||||
|
content: string,
|
||||||
|
id: string,
|
||||||
|
}).content as string || ""
|
||||||
|
}
|
||||||
|
tableHTML += `<div class="av__cell" ${index === 0 ? 'data-block-id="' + ((cell.renderValue as {
|
||||||
|
content: string,
|
||||||
|
id: string
|
||||||
|
}).id || "") + '"' : ""} data-id="${cell.id}" data-index="${index}" style="width: ${data.columns[index].width || 200}px;${cell.bgColor ? `background-color:${cell.bgColor};` : ""}${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
||||||
});
|
});
|
||||||
tableHTML += "<div></div></div>";
|
tableHTML += "<div></div></div>";
|
||||||
});
|
});
|
||||||
|
|
|
||||||
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
|
|
@ -837,8 +837,9 @@ interface IAVCell {
|
||||||
color: string,
|
color: string,
|
||||||
bgColor: string,
|
bgColor: string,
|
||||||
value: string,
|
value: string,
|
||||||
|
valueType: TAVCol,
|
||||||
renderValue: {
|
renderValue: {
|
||||||
content: string,
|
content: string,
|
||||||
id: string,
|
id: string,
|
||||||
}
|
} | string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue