真亦天
真亦天
  • 发布:2018-03-14 11:08
  • 更新:2018-03-14 12:43
  • 阅读:1241

[疑问:是否是BUG]如果使用mui.openWindow()方法,系统无法使用matchUrls将无法识别

分类:wap2app

[疑问:是否是BUG]如果使用mui.openWindow()方法,系统无法使用matchUrls将无法识别?请问如何解决。
举例:hello.wap2app.dcloud.io 上面的代码我download到我的电脑中,随便删除一个功能的href,例如

<a class="mui-navigate-right" href="examples/titleNView-transparent.html">  
		透明渐变导航栏  
</a>

将href删除改成onclick方法,执行的就是

//--执行,页面跳转--  
mui.openWindow({  
      id:"titleNView-transparent",  
      url:'examples/titleNView-transparent.html'  
})

后面就写的,这段代码就失效,透明的效果就没有了。。

{  
    "webviewId": "titleNView-transparent",  
    "matchUrls": [{  
         “href”:“http://www.xx.com/test/examples/titleNView-transparent.html”  
}],//page1页面链接匹配规则  
    "webviewParameter":{  
        "titleNView":{  
            "type":"transparent",//透明渐变样式  
        }  
    },  
} 

是不是大家也有这个问题,很尴尬

2018-03-14 11:08 负责人:无 分享
已邀请:
Trust

Trust - 少说废话

mui 在设计时,为了兼容普通浏览器和 5+Runtime 环境,因而在 5+Runtime 环境下会调用 5+API 打开目标 Webview,而不是执行 window.location.href 跳转。
wap2app 应用的匹配规则,仅限于在 Webview 中的 location.href 这种重新加载下发 Document(即HTML资源)的跳转。

修改方案:在网站源码中,将 mui.openWindow 替换为 window.location.href。

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