mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
add hotkey
This commit is contained in:
1 parent
e8e8f7e8e7
commit
3bf0007e5e
18 files changed
+227
-41
No files matched your search
+8
-1
@@ -1,12 +1,19 @@
|
||||
export default class Notice {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
show(msg) {
|
||||
show(msg, autoHide) {
|
||||
const { refs: { $notice } } = this.art;
|
||||
$notice.style.display = 'block';
|
||||
$notice.innerHTML = msg instanceof Error ? msg.message.trim() : msg;
|
||||
if (autoHide) {
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(() => {
|
||||
this.hide();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
hide() {
|
||||
|
||||
Reference in new issue
Block a user