mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
添加log插件demo
This commit is contained in:
1 parent
888c929549
commit
e6242df6d3
4 files changed
+17
-1
No files matched your search
@@ -6,6 +6,9 @@ export default function log(art) {
|
||||
let $log = null;
|
||||
layers.add({
|
||||
name: 'log',
|
||||
style: {
|
||||
bottom: '50px',
|
||||
},
|
||||
mounted($el) {
|
||||
$log = $el;
|
||||
},
|
||||
@@ -17,6 +20,7 @@ export default function log(art) {
|
||||
|
||||
function check() {
|
||||
const count = $log.childElementCount;
|
||||
setStyle($log, 'bottom', art.controls.show ? '50px' : '10px');
|
||||
if (count) {
|
||||
if (count > max) {
|
||||
remove($log.firstElementChild);
|
||||
@@ -37,6 +41,7 @@ export default function log(art) {
|
||||
return {
|
||||
name: 'log',
|
||||
emit(msg) {
|
||||
if (typeof msg !== 'string') return;
|
||||
append($log, `<p>${escape(msg)}</p>`);
|
||||
setStyle($log, 'display', 'block');
|
||||
clearTimeout(timer);
|
||||
|
||||
Reference in new issue
Block a user