Vanessa 2022-09-29 22:26:55 +08:00
parent 56129699b9
commit bc78b43dfe
5 changed files with 64 additions and 14 deletions

View file

@ -364,7 +364,7 @@ export class Breadcrumb {
this.id = id;
fetchPost("/api/block/getBlockBreadcrumb", {id}, (response) => {
let html = "";
response.data.forEach((item: { id: string, name: string, type: string, subType: string, children: [] }, index: number) => {
response.data.forEach((item: IBreadcrumb, index: number) => {
let isCurrent = false;
if (!protyle.block.showAll && item.id === protyle.block.parentID) {
isCurrent = true;

View file

@ -25,6 +25,7 @@ import {Background} from "./header/Background";
import {getDisplayName} from "../util/pathName";
import {onGet} from "./util/onGet";
import {reloadProtyle} from "./util/reload";
import {renderBacklink} from "./wysiwyg/renderBacklink";
class Protyle {
@ -155,6 +156,11 @@ class Protyle {
}
}
});
setPadding(this.protyle);
if (options.backlinkData) {
renderBacklink(this.protyle, options.backlinkData)
return
}
fetchPost("/api/filetree/getDoc", {
id: options.blockId,
k: options.key || "",
@ -201,7 +207,6 @@ class Protyle {
mergedOptions.after(this);
}
});
setPadding(this.protyle);
}
}

View file

@ -0,0 +1,6 @@
export const renderBacklink = (protype: IProtyle, backlinkData: {
blockPaths: IBreadcrumb[],
dom: string
}[]) => {
}