mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 02:51:20 -08:00
update template
This commit is contained in:
1 parent
145d6b7a96
commit
af9f9b3263
2 files changed
+6
-5
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from 'react';
|
||||||
import Artplayer from "artplayer";
|
import Artplayer from 'artplayer';
|
||||||
|
|
||||||
export default function ({ option, getInstance, ...rest }) {
|
export default function ({ option, getInstance, ...rest }) {
|
||||||
const artRef = useRef();
|
const artRef = useRef();
|
||||||
@@ -10,7 +10,7 @@ export default function ({ option, getInstance, ...rest }) {
|
|||||||
container: artRef.current,
|
container: artRef.current,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (getInstance && typeof getInstance === "function") {
|
if (getInstance && typeof getInstance === 'function') {
|
||||||
getInstance(art);
|
getInstance(art);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ export default function ({ option, getInstance, ...rest }) {
|
|||||||
art.destroy(false);
|
art.destroy(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [option, getInstance]);
|
}, []);
|
||||||
|
|
||||||
return <div ref={artRef} {...rest}></div>;
|
return <div ref={artRef} {...rest}></div>;
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,8 @@ export default function Player({ option, getInstance, ...rest }) {
|
|||||||
art.destroy(false);
|
art.destroy(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [option, getInstance]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
return React.createElement('div', {
|
return React.createElement('div', {
|
||||||
ref: artRef,
|
ref: artRef,
|
||||||
|
|||||||
Reference in new issue
Block a user