本文整理汇总了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;未经允许,请勿转载。 |
请发表评论