Skip to content

Commit e6a3e9c

Browse files
authored
Merge pull request #10 from lanqy/master
单页面加载不同的页面时会生成多个 load mark,关闭的时候全部移除
2 parents efda63a + a367e69 commit e6a3e9c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Toast.install = function (Vue, options) {
5050

5151
setTimeout(function () {
5252
toastVM.show = showToast = false;
53+
var elements = document.getElementsByClassName('lx-load-mark');
54+
for (var i = 0; i < elements.length; i++) { // 单页面加载不同的页面时会生成多个 load mark,隐藏的时候全部移除
55+
elements[i].remove()
56+
}
5357
}, opt.duration)
5458
};
5559
['bottom', 'center', 'top'].forEach(function (type) {
@@ -88,4 +92,4 @@ Toast.install = function (Vue, options) {
8892
}
8993
});
9094
}
91-
module.exports = Toast;
95+
module.exports = Toast;

0 commit comments

Comments
 (0)