ShtukbaseStandard
包文件→ .shtukbase/packages/layout-minimal/test/fixtures/layout-plain/layout.js

test/fixtures/layout-plain/layout.js

18 行, 752 B.

文件按包中的原样显示:代码及其注释不做翻译。

  1. window.Layout = {
  2. mount(root, { sidebar, panel, page, slot, connect }) {
  3. const navigation = slot("aside", "shell-sidebar", null, sidebar);
  4. const settings = slot("aside", "shell-right", null, panel);
  5. const body = slot("main", "shell-main", null, page);
  6. const cardHost = slot("div", "layout-card-host", { hidden: true, "data-state": "closed" });
  7. const shell = slot("div", "shell", { "data-arrangement": "docked" }, navigation, settings, body, cardHost);
  8. root.append(shell);
  9. return connect({
  10. shell, body, cardHost, sidebar: navigation, panel: settings,
  11. insertLeft(left) {
  12. const region = slot("aside", "shell-left", null, left);
  13. body.before(region);
  14. return region;
  15. },
  16. });
  17. },
  18. };