當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript preact.h函數代碼示例

本文整理匯總了TypeScript中preact.h函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript h函數的具體用法?TypeScript h怎麽用?TypeScript h使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了h函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: render

 render() {
   if (!this.state.latest) {
     return h(Loading, null);
   }
   const notebookList = this.state.latest.map(info => {
     const snippit = info.doc.cells.map(normalizeCode)
       .join("\n")
       .slice(0, 100);
     const href = nbUrl(info.nbId);
     return h("li", null,
       h("a", { href },
         notebookBlurb(info.doc, false),
         snippit
       ),
     );
   });
   return h("div", { "class": "most-recent" },
     h("button", {
       "class": "create-notebook",
       "onClick": () => this.onCreate(),
     }, "Create Empty Notebook"),
     h("h2", null, "Recently Updated"),
     h("ol", null, ...notebookList),
   );
 }
開發者ID:Befirst-Solutions,項目名稱:propel,代碼行數:25,代碼來源:notebook.ts

示例2: div

export const PropelIndex = (props) => {
  return div("index",
    h(Splash, props),
    h(Intro, null),
    h(UseIt, null),
    h(Perks, null),
    h(ReferencesFooter, null),
  );
};
開發者ID:Befirst-Solutions,項目名稱:propel,代碼行數:9,代碼來源:website.ts

示例3: readFileSync

export const References = (props) => {
  const refhtml = readFileSync(__dirname + "/references.html", "utf8");
  return div("references",
    h(GlobalHeader, { subtitle: "References" }),
    p("This work is inspired by and built upon great technologies."),
    h("div", {
      dangerouslySetInnerHTML: { __html: refhtml },
    }),
  );
};
開發者ID:Befirst-Solutions,項目名稱:propel,代碼行數:10,代碼來源:website.ts

示例4: GlobalHeader

export function GlobalHeader(props) {
  return h("div", { "class": "global-header" },
    h("div", { "class": "global-header-inner" },
      h(PropelLogo, {
        subtitle: props.subtitle,
        subtitleLink: props.subtitleLink,
      }),
      h("div", { "class": "global-header-right" }, ...props.children)
    ),
  );
}
開發者ID:Befirst-Solutions,項目名稱:propel,代碼行數:11,代碼來源:common.ts

示例5: notebookBlurb

function notebookBlurb(doc: db.NotebookDoc, showDates = true): JSX.Element {
  const dates = !showDates ? [] : [
    h("p", { "class": "created" }, `Created ${fmtDate(doc.created)}.`),
    h("p", { "class": "updated" }, `Updated ${fmtDate(doc.updated)}.`),
  ];
  return h("div", { "class": "blurb" }, null, [
    h(Avatar, { userInfo: doc.owner }),
    h("p", { "class": "displayName" }, doc.owner.displayName),
    ...dates
  ]);
}
開發者ID:Befirst-Solutions,項目名稱:propel,代碼行數:11,代碼來源:notebook.ts

示例6: nbUrl

 const notebookList = this.state.latest.map(info => {
   const snippit = info.doc.cells.map(normalizeCode)
     .join("\n")
     .slice(0, 100);
   const href = nbUrl(info.nbId);
   return h("li", null,
     h("a", { href },
       notebookBlurb(info.doc, false),
       snippit
     ),
   );
 });
開發者ID:Befirst-Solutions,項目名稱:propel,代碼行數:12,代碼來源:notebook.ts


注:本文中的preact.h函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。