This commit is contained in:
Harvey committed 2021-12-10 08:36:46 +08:00
1 parent dc2345306c
commit a6917400c3
10 files changed
+110 -17

No files matched your search

@@ -0,0 +1,36 @@
<template>
<div ref="artRef"></div>
</template>
<script>
import Artplayer from '../../';
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>