- Source:
框架的方法集合,是全局公用对象
Methods
(static) addAnnounceEvent(name, fn)
- Source:
注册一个全局事件,可以通过xjs.triggerAnnounceEvent触发
Parameters:
Name | Type | Description |
---|---|---|
name |
String | 事件名 |
fn |
function | 回调函数 |
(static) byId(id) → {Object}
- Source:
获取一个已实例化的Page类,传入Page类的id后获取到对象
Parameters:
Name | Type | Description |
---|---|---|
id |
String | 传入实例化的Page类的 |
Returns:
当前id所对应的Page类的this对象
- Type
- Object
(static) createView(name, paramopt, wrapperopt, defaultNodeopt)
- Source:
- See:
实例化一个Page类,请确已申明这个类。xjs.declare
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | 已申明的Page类名 |
|
param |
Object |
<optional> |
可选参数,可选此对象将会和Page对象合并 |
wrapper |
Object |
<optional> |
可选参数,传入Dom节点则会以这个节点为父节点,否则就会在 |
defaultNode |
Boolean |
<optional> |
可选参数,选择以Wrapper或Wrapper的子节点作为主节点,将会插入模板到此结点 |
(static) declare(classname, parents, prop)
- Source:
- See:
申明一个Page类,所有Page类都需要先申明后才可以作为参数被被creatView使用
Parameters:
Name | Type | Description |
---|---|---|
classname |
String | Page类的名字 |
parents |
Object | 此Page类的父类继承对象,通常使用 |
prop |
Object | Page类的方法 |
(static) destroyView(id)
- Source:
- See:
销毁一个Page类,并触发onExit事件
Parameters:
Name | Type | Description |
---|---|---|
id |
string | 实例化后的Page类的 |
(static) getUserInfo() → {Object}
获取用户数据
Returns:
用户数据
- Type
- Object
(static) load()
- Source:
- See:
挂载ajax模块
(static) removeAnnounceEvent(name)
- Source:
注销一个全局事件
Parameters:
Name | Type | Description |
---|---|---|
name |
String | 事件名 |
(static) setUserInfo(data)
更新用户数据
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | 用户数据 |
(static) tool()
框架内部的工具库
(static) triggerAnounceEvent(name)
- Source:
触发一个全局事件
Parameters:
Name | Type | Description |
---|---|---|
name |
String | 事件名 |