[关闭]
@mansonchor 2014-03-31T05:46:43.000000Z 字数 530 阅读 597

page_control.init( container , [options] )

@return {none}

@param {dom | zepto对象} container : 承载页面的容器

@param {json} options

{string} default_index_route : 当初次进入应用没有指定路由地址时,默认自动路由到该地址

{string} default_title : 浏览器的title显示,页面没有特定title时的默认显示文案

{function} before_route : 在控制器路由响应之前触发

{function} after_route : 在控制器路由响应之后触发

代码示例

  1. var $ = require('zepto')
  2. var page_control = require('page_control')
  3. page_control.init( $('.page_container') ,
  4. {
  5. default_title : "xxxxx",
  6. default_index_route : "index",
  7. before_route : function()
  8. {
  9. alert('before_route ')
  10. },
  11. after_route : function()
  12. {
  13. alert('after_route ')
  14. }
  15. })
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注