update docs

This commit is contained in:
Harvey committed 2022-05-06 10:46:17 +08:00
1 parent 194c65778b
commit d88a992efb
51 files changed
+219 -220

No files matched your search

+22 -22
View File
@@ -1,31 +1,31 @@
<template>
<Artplayer @get-instance="getInstance" :option="option" :style="style" />
<Artplayer @get-instance="getInstance" :option="option" :style="style" />
</template>
<script>
import Artplayer from "./Artplayer.vue";
import Artplayer from './Artplayer.vue';
export default {
data() {
return {
option: {
url: "https://artplayer.org/assets/sample/video.mp4",
autoSize: true,
},
style: {
width: "600px",
height: "400px",
margin: "60px auto 0",
},
};
},
components: {
Artplayer,
},
methods: {
getInstance(art) {
console.log(art);
data() {
return {
option: {
url: 'https://artplayer.org/assets/sample/video.mp4',
autoSize: true,
},
style: {
width: '600px',
height: '400px',
margin: '60px auto 0',
},
};
},
components: {
Artplayer,
},
methods: {
getInstance(art) {
console.log(art);
},
},
},
};
</script>
@@ -1,36 +1,36 @@
<template>
<div ref="artRef"></div>
<div ref="artRef"></div>
</template>
<script>
import Artplayer from "artplayer";
import Artplayer from 'artplayer';
export default {
data() {
return {
instance: null,
};
},
props: {
option: {
type: Object,
required: true,
data() {
return {
instance: null,
};
},
},
mounted() {
this.instance = new Artplayer({
...this.option,
container: this.$refs.artRef,
});
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();
}
},
this.$nextTick(() => {
this.$emit('get-instance', this.instance);
});
},
beforeUnmount() {
if (this.instance && this.instance.destroy) {
this.instance.destroy(false);
}
},
};
</script>