Soulic
Soulic
  • 发布:2016-04-27 12:01
  • 更新:2018-04-08 11:15
  • 阅读:2279

自定义事件问题(底部选项卡-webview模式)

分类:MUI

在做基于基于webview模式的底部选项卡应用中,想在选项卡之间用自定义事件,请问以下改怎么实现?
以下是我的实现方式,不过没有效果

        mui('.mui-bar-tab').on('tap', '.mui-tab-item', function() {  
            var tabitem = this;  
            if (tabitem == curTabItem) {  
                return;  
            }  
            curTabItem = tabitem;  
            navtitle.innerText = tabitem.children[tabitem.children.length - 1].innerText;  

            if (tabitem.getAttribute('href') == "bar/test.html")  
            {  
                if (!page) page = tabitem;  
                mui.fire(page, "test");  
            }  

            //设置将显示当前webview  
            showCurWebView(tabitem.getAttribute('href'));  
            lastActiveTabs.push(activeTab);  
            activeTab = tabitem;  
        });

在日志中提示错误: Uncaught TypeError: b.evalJS is not a function at js/mui.min.js:6

2016-04-27 12:01 负责人:无 分享
已邀请:
f***@gmail.com

f***@gmail.com

我也遇到了相同的问题,都没人回复~提出了一个新的框架,却不解决这个框架里的一些问题~

  • 回梦無痕

    仔细看文档,

    mui.fire(detailPage,'newsId',{

    id:id

    });其中的detailPage是某个webview页对象。

    2017-12-28 14:15

  • f***@gmail.com

    是啊,居然犯这种低级的错误,还看了半天。。。

    2017-12-28 14:34

essense

essense - 民工一枚

最新版sdk还是有这样的问题, 如何解决?

该问题目前已经被锁定, 无法添加新回复