[_]
This commit is contained in:
parent
0e16989b4d
commit
5e09bdf252
1 changed files with 41 additions and 0 deletions
|
|
@ -49,6 +49,47 @@ func (page *Page) EditorRender(request *Request) (*ResponseEditorRender, error)
|
||||||
res.Scripts = append(res.Scripts, filepath.Join("@pages", page.Route, page.Name+".ts"))
|
res.Scripts = append(res.Scripts, filepath.Join("@pages", page.Route, page.Name+".ts"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Render tools
|
||||||
|
// res.Scripts = append(res.Scripts, filepath.Join("@assets", "__render.js"))
|
||||||
|
|
||||||
|
// doc, _, err := page.Build(&BuildOption{
|
||||||
|
// SSR: true,
|
||||||
|
// AssetRoot: request.AssetRoot,
|
||||||
|
// })
|
||||||
|
|
||||||
|
// doc.Selection.Find("body").AppendHtml(`
|
||||||
|
// <script>
|
||||||
|
// console.log("setIframeHeight window.onload: setIframeHeight");
|
||||||
|
// function setIframeHeight(height) {
|
||||||
|
// window.parent.postMessage(
|
||||||
|
// {
|
||||||
|
// messageType: "setIframeHeight",
|
||||||
|
// iframeHeight: height,
|
||||||
|
// },
|
||||||
|
// "` + request.Referer + `"
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// window.onload = function () {
|
||||||
|
// console.log("window.onload: setIframeHeight");
|
||||||
|
// const contentHeight = document.documentElement.scrollHeight;
|
||||||
|
// console.log("window.onload: setIframeHeight", contentHeight);
|
||||||
|
// try {
|
||||||
|
// setIframeHeight(contentHeight + "px");
|
||||||
|
// } catch (err) {
|
||||||
|
// console.log(` + "`" + `setIframeHeight error: ${err}` + "`" + `);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// </script>
|
||||||
|
// `)
|
||||||
|
|
||||||
|
// html, err = doc.Html()
|
||||||
|
// if err != nil {
|
||||||
|
// return nil, err
|
||||||
|
// }
|
||||||
|
|
||||||
|
// fmt.Println(html)
|
||||||
|
|
||||||
data, setting, err := page.Data(request)
|
data, setting, err := page.Data(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Warnings = append(res.Warnings, err.Error())
|
res.Warnings = append(res.Warnings, err.Error())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue