标签:
Model 组件专门用来存放 Data 组件。
component-name 组件名称
xid WeX5 中组件的唯一性标识
onActive 页面激活
onInactive 页面离开
onModelContruct 数据模型创建时
onModelContructDone 数据模型创建完成
onLoad 页面初始化完成
onunLoad 页面关闭
onParamsReceive 接收参数
验证 Model 各个事件的执行优先顺序
define(function(require){ var $ = require("jquery"); var justep = require("$UI/system/lib/justep"); var Model = function(){ this.callParent(); }; Model.prototype.modelActive = function(event){ console.log("model active."); }; Model.prototype.modelInactive = function(event){ console.log("model inactive."); }; Model.prototype.modelModelConstruct = function(event){ console.log("model contruct."); }; Model.prototype.modelModelConstructDone = function(event){ console.log("model contruct done."); }; Model.prototype.modelLoad = function(event){ console.log("model load."); }; Model.prototype.modelParamsReceive = function(event){ console.log("model params receive."); }; Model.prototype.modelUnLoad = function(event){ console.log("model un load."); }; return Model; });
model contruct.
model contruct done.
model load.
model params receive.
事件执行顺序:onModelContruct --> onModelContructDone --> onLoad --> onParamsReceive
标签:
原文地址:http://www.cnblogs.com/longying2008/p/5353056.html