mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
This commit is contained in:
parent
cdb0024664
commit
4a945303a4
2 changed files with 37 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ import {processRender} from "../util/processCode";
|
|||
import {AIChat} from "../../ai/chat";
|
||||
import {isMobile} from "../../util/functions";
|
||||
import {isCtrl} from "../util/compatibility";
|
||||
import {avRender} from "../render/av";
|
||||
|
||||
export class Hint {
|
||||
public timeId: number;
|
||||
|
|
@ -683,6 +684,8 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
|
|||
nodeElement.querySelectorAll("colgroup col").forEach((item: HTMLElement) => {
|
||||
item.style.minWidth = "60px";
|
||||
});
|
||||
} else if (nodeElement.classList.contains("av")) {
|
||||
avRender(nodeElement)
|
||||
}
|
||||
transaction(protyle, [{
|
||||
data: oldHTML,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,36 @@
|
|||
export const avRender = (element: Element) => {
|
||||
|
||||
export const avRender = (element: Element) => {
|
||||
let avElements: Element[] = [];
|
||||
if (element.getAttribute("data-type") === "NodeAttributeView") {
|
||||
// 编辑器内代码块编辑渲染
|
||||
avElements = [element];
|
||||
} else {
|
||||
avElements = Array.from(element.querySelectorAll('[data-type="NodeAttributeView"]'));
|
||||
}
|
||||
if (avElements.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (avElements.length > 0) {
|
||||
avElements.forEach((e: HTMLDivElement) => {
|
||||
if (e.getAttribute("data-render") === "true") {
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
filter:{},
|
||||
sorts: {},
|
||||
columns:[{
|
||||
id:"",
|
||||
name:"",
|
||||
type:"",
|
||||
}],
|
||||
rows:[{
|
||||
id:"",
|
||||
cells:[{
|
||||
value:"",
|
||||
}]
|
||||
}]
|
||||
}
|
||||
e.setAttribute("data-render", "true");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue