基本形式

<jr-button on-click="{this.showLoading()}" title="显示加载, 2秒后隐藏" />
<jr-loading visible={visible} />
var component = new JRUI.Component({
template: template,
config: function(data) {
data.visible = false;
},
showLoading: function() {
this.data.visible = true;
setTimeout(function() {
this.$update('visible', false);
}.bind(this), 2000);
}
});

嵌入文档流

<jr-button on-click="{visible = !visible}" title="{visible ? '隐藏加载' : '显示加载'}" />
<p>
<jr-loading visible={visible} static />
</p>
var component = new JRUI.Component({
template: template,
config: function(data) {
data.visible = false;
}
});

API

JRLoading

Kind: global class

new JRLoading()

Param Type Default Description
[options.data] object = 绑定属性
[options.data.static] boolean false => 是否嵌入文档流
[options.data.disabled] boolean false => 是否禁用, 禁用后调用show和hide则无效
[options.data.visible] boolean false => 是否显示
[options.data.class] string => 补充class

jrLoading.show() 显示组件() ⇒ void

Kind: instance method of JRLoading

jrLoading.hide() 隐藏组件() ⇒ void

Kind: instance method of JRLoading

JRLoading.loading

Kind: static property of JRLoading

Param Description
loading 内部静态实例, 使用NEKUI.JRLoading的静态方法时,内部使用的是这个实例

JRLoading.show()

Kind: static method of JRLoading

JRLoading.hide()

Kind: static method of JRLoading