update docs

This commit is contained in:
Harvey committed 2022-05-06 10:21:32 +08:00
1 parent 481d8fefbb
commit 194c65778b
145 files changed
+871 -510

No files matched your search

@@ -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();
}
},
};
</script>
+26 -26
View File
@@ -1,35 +1,35 @@
<template>
<div>
<client-only placeholder="loading...">
<Artplayer @get-instance="getInstance" :option="option" :style="style" />
</client-only>
</div>
<div>
<client-only placeholder="loading...">
<Artplayer @get-instance="getInstance" :option="option" :style="style" />
</client-only>
</div>
</template>
<script>
import Artplayer from "./Artplayer.vue";
import Artplayer from './Artplayer.vue';
export default {
components: {
Artplayer,
},
data() {
return {
option: {
url: "https://artplayer.org/assets/sample/video.mp4",
autoSize: true,
},
style: {
width: "600px",
height: "400px",
margin: "60px auto 0",
},
};
},
methods: {
getInstance(art) {
console.log(art);
components: {
Artplayer,
},
data() {
return {
option: {
url: 'https://artplayer.org/assets/sample/video.mp4',
autoSize: true,
},
style: {
width: '600px',
height: '400px',
margin: '60px auto 0',
},
};
},
methods: {
getInstance(art) {
console.log(art);
},
},
},
};
</script>