weex
weex copied to clipboard
导航条右边按钮点击后无法得到naviBar.rightItem.click事件的情况
naviBar.rightItem.click 导航条的右边按钮按下后,on的函数中无法得到naviBar.rightItem.click这个事件,但left的事件可以得到。
我的测试结果如下:
<wxc-navpage data-role="none" background-color="#ff5898" title="频道列表" title-color="white" left-item-title="返回" right-item-title="频道" right-item-src="http://gtms02.alicdn.com/tps/i2/TB1ED7iMpXXXXXEXXXXWA_BHXXX-48-48.png">
如果不设置right-item-src,而是设置成文字(right-item-title),则naviBar右边的按钮点击后,程序无法得到naviBar.rightItem.click事件。
我用examples里面的navigator-demo.we来测试,也使用过自己写的代码测试过,效果一样。
@luics
wxc-navbar.we这里有个拼写错误 onclickrigthitem
<template>
<div class="container" style="height:{{height}}; background-color:{{backgroundColor}};" data-role={{dataRole}}>
<text class="right-text" style="color:{{rightItemColor}};" navi-item-position="right" if={{!rightItemSrc}} onclick = "onclickrigthitem">{{rightItemTitle}}</text>
<image class="right-image" navi-item-position="right" src={{rightItemSrc}} if={{rightItemSrc}} onclick="onclickrightitem"></image>
<text class="left-text" style="color:{{leftItemColor}};" navi-item-position="left" if={{!leftItemSrc}} onclick= "onclickleftitem">{{leftItemTitle}}</text>
<image class="left-image" navi-item-position="left" src={{leftItemSrc}} if={{leftItemSrc}} onclick="onclickleftitem"></image>
<text class="center-text" style="color:{{titleColor}};" navi-item-position="center">{{title}}</text>
</div>
</template>
sorry, it is really a spelling mistake , we will fix it soon.
fixed