提交 32f7e7bf 编写于 作者: C Catouse

* add destory method to messager and update it's document.

上级 308ccb34
......@@ -336,6 +336,13 @@ msg.hide();
```
如果确定消息实例不再使用,可以调用 `destory()` 方法来销毁消息。
```
// 销毁消息
myMsg.detory();
```
### 快速显示
使用 `$.zui.messager` 实例的 `show()` 方法来即时显示一个漂浮消息。
......
......@@ -176,7 +176,7 @@
that.$.removeClass('in');
setTimeout(function() {
var $parent = that.$.parent();
that.$.remove();
that.$.detach();
if(!$parent.children().length) $parent.remove();
callback && callback(true);
}, 200);
......@@ -187,6 +187,11 @@
that.isShow = false;
};
Messager.prototype.destory = function() {
that.$.remove();
that.$ = null;
};
var showMessage = function(message, options) {
if(typeof options === 'string') {
options = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册