Skip to content

Commit

Permalink
Merge pull request #16 from F-loat/patch-1
Browse files Browse the repository at this point in the history
增加容错处理
  • Loading branch information
lin-xin authored Mar 23, 2018
2 parents 813764e + 4bd3e28 commit 7f2c2bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ Toast.install = function (Vue, options) {
Vue.prototype.$loading = function (tips, type) {
if (type == 'close') {
loadNode.show = showLoad = false;
document.querySelector('.lx-load-mark').remove();
var markNode = document.querySelector('.lx-load-mark');
if (markNode) markNode.remove();
} else {
if (showLoad) {
// 如果loading还在,则不再执行
Expand Down Expand Up @@ -89,4 +90,4 @@ Toast.install = function (Vue, options) {
}
});
}
module.exports = Toast;
module.exports = Toast;

0 comments on commit 7f2c2bd

Please sign in to comment.