2 个回答

navpage的使用,是需要把所有子视图放在navpage里面的,格式如下:

<wxc-navpage>
    <div>...</div>
</wxc-navpage>

这些你都都可以查看weex-components模块下的wxc-navpage源码查看,具体实现如下

<template>
      <div class="wrapper">
          <wxc-navbar data-role={{dataRole}} height={{height}} background-color={{backgroundColor}} title={{title}} title-color={{titleColor}} left-item-src={{leftItemSrc}} left-item-title={{leftItemTitle}} left-item-color={{leftItemColor}} right-item-src={{rightItemSrc}} right-item-title={{rightItemTitle}} right-item-color={{rightItemColor}}></wxc-navbar>
          <div class="wrapper" style="margin-top:{{height}}">
                <content></content>
          </div>
      </div>
</template>

上面的代码包含了一个<content></content>的标签。所以你可以把子视图放到navpage里面去看看

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进