|
定义一个main.w 里面有很多按钮,可以跳转到不同页面。
main.w是放在UI2目录下面test/main/main.w
下面是main.w一个按钮
- <div class="card">
- <a component="$UI/system/components/justep/button/button" class="btn btn-link btn-lg btn-icon-top"
- label="列表" xid="button1" icon="icon-android-storage" onClick="openDemo"
- url="/test/list/list.w" style="width:120px;height:93px;left:0px;top:0px;">
- <i xid="i2" class="icon-android-storage" style="color: rgb(153, 196, 18);"/>
- <span xid="span2"/>
- </a>
- </div>
复制代码
下面是main.js
- <p>define(function(require){
- var $ = require("jquery"),
- FastClick = require("$UI/system/components/justep/lib/fastclick"),
- History = require("$UI/system/lib/history/history"),
- justep = require("$UI/system/lib/justep");
-
- require("$UI/system/lib/cordova/cordova");
- require('$UI/system/lib/jquery/transition');
-
- require("w!$UI/test/list/list.w");</p><p> var Model = function(){
- this.callParent();
- };</p><p> Model.prototype.backBtn1Click = function(event){
- justep.Portal.closeWindow();
- };</p><p> Model.prototype.openDemo = function(event){
- var url = '$UI' + event.source.$domNode.attr('url');
- justep.Portal.openWindow(url);
- alert(url);
- };</p><p> return Model;
- });</p>
复制代码
浏览器和模拟器运行点击列表不跳转到/test/list/list.w页面,不知道为什么,是不是什么包没引用。麻烦解答一下。
/test/list/list.w 是放在UI2目录下的,浏览器中使用http://ip/x5/UI2/test/list/list.w是可以打开的
|
|