siyuan/app/src/protyle/toolbar/util.ts

8 lines
292 B
TypeScript
Raw Normal View History

import {fetchPost} from "../../util/fetch";
export const previewTemplate = (pathString: string, element: Element) => {
fetchPost("/api/file/getFile", {path: pathString.replace(window.siyuan.config.system.dataDir, "")}, (response) => {
element.innerHTML = response.data;
})
}