-
Notifications
You must be signed in to change notification settings - Fork 64
2.0编程接口
zhangwentao edited this page Jun 14, 2016
·
1 revision
Her 提供的编程接口如下:
- {html}{/html} 标签
- {head}{/head} 标签
- {title}{/title} 标签
- {body}{/body} 标签
- {pagelet [html-tag="div"]}{/pagelet} 标签
- {script [pagelet-on="load"] [var-varName=$data]}{/script} 标签
- {require name="resourcePath"} 标签
- {define [method="methodName"]}{/define} 标签
- {widget name="resourcePath" [method="methodName"]} 标签
- BigPipe.fetch(pagelets[, url, cache]) 函数
- require(moduleName) 函数
- require.defer(moduleList[, callback]) 函数
- require.async(moduleList[, callback]) 函数
- __inline(moduleName) 函数
- __uri(moduleName) 函数
下面的代码展示了 Her 提供的部分API:
{html her="common:static/lib.js"}
{head}
{title}This is title{/title}
{require name="common:reset.css"}
...some thing else in head.
{/head}
{body}
...some thing outside before pagelet.
{require name="common:page.css"}
{pagelet id="mypagelet"}
{require name="module:pagelet.css"}
...some thing inside pagelet.
{/pagelet}
...some thing outside after pagelet.
{/body}
{/html}