remove examples dir

This commit is contained in:
Harvey Zack committed 2022-11-04 20:29:15 +08:00
1 parent 1ca9ffa832
commit 4092b51c4e
3 files changed
+2 -65

No files matched your search

@@ -1,28 +0,0 @@
import React, { useEffect, useRef } from 'react';
import Artplayer from 'artplayer';
export default function Player({ option, getInstance, ...rest }) {
const artRef = useRef();
useEffect(() => {
const art = new Artplayer({
...option,
container: artRef.current,
});
if (getInstance && typeof getInstance === 'function') {
getInstance(art);
}
return () => {
if (art && art.destroy) {
art.destroy(false);
}
};
}, []);
return React.createElement('div', {
ref: artRef,
...rest,
});
}
@@ -1,36 +0,0 @@
<template>
<div ref="artRef"></div>
</template>
<script>
import Artplayer from 'artplayer';
export default {
data() {
return {
instance: null,
};
},
props: {
option: {
type: Object,
required: true,
},
},
mounted() {
this.instance = new Artplayer({
...this.option,
container: this.$refs.artRef,
});
this.$nextTick(() => {
this.$emit('get-instance', this.instance);
});
},
beforeUnmount() {
if (this.instance && this.instance.destroy) {
this.instance.destroy();
}
},
};
</script>