mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
格式化
This commit is contained in:
1 parent
0454f785be
commit
203ad0d3a0
75 files changed
+3120
-2904
No files matched your search
@@ -1,27 +1,27 @@
|
||||
import { setStyle } from './utils';
|
||||
|
||||
export default class Notice {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
show(msg, autoHide = true, time = 1000) {
|
||||
const { $notice, $noticeInner } = this.art.refs;
|
||||
setStyle($notice, 'display', 'block');
|
||||
$noticeInner.innerHTML = msg instanceof Error ? msg.message.trim() : msg;
|
||||
if (autoHide) {
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(() => {
|
||||
this.hide();
|
||||
}, time);
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
this.timer = null;
|
||||
}
|
||||
this.art.emit('notice:show', $notice);
|
||||
}
|
||||
|
||||
hide() {
|
||||
const { $notice } = this.art.refs;
|
||||
setStyle($notice, 'display', 'none');
|
||||
this.art.emit('notice:hide', $notice);
|
||||
}
|
||||
show(msg, autoHide = true, time = 1000) {
|
||||
const { $notice, $noticeInner } = this.art.refs;
|
||||
setStyle($notice, 'display', 'block');
|
||||
$noticeInner.innerHTML = msg instanceof Error ? msg.message.trim() : msg;
|
||||
if (autoHide) {
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(() => {
|
||||
this.hide();
|
||||
}, time);
|
||||
}
|
||||
this.art.emit('notice:show', $notice);
|
||||
}
|
||||
|
||||
hide() {
|
||||
const { $notice } = this.art.refs;
|
||||
setStyle($notice, 'display', 'none');
|
||||
this.art.emit('notice:hide', $notice);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user