vuepress-plugin-sbaudio
Version:
A music player plugin for vuepress use aplayer and meting
68 lines (67 loc) • 2.01 kB
JavaScript
import { defineComponent, h } from "vue";
import APlayer from "../Meting/meting.js";
// @ts-ignore
import { aplayerOptions } from "@temp/SbAudioOptions.json";
const APlayerOptionsDefault = aplayerOptions;
export default defineComponent({
props: {
fixed: {
type: Boolean,
default: APlayerOptionsDefault.fixed,
},
mini: {
type: Boolean,
default: APlayerOptionsDefault.mini,
},
autoplay: {
type: Boolean,
default: APlayerOptionsDefault.autoplay,
},
theme: {
type: String,
default: APlayerOptionsDefault.theme,
},
loop: {
type: String,
default: APlayerOptionsDefault.loop,
},
order: {
type: String,
default: APlayerOptionsDefault.order,
},
preload: {
type: String,
default: APlayerOptionsDefault.preload,
},
volume: { type: Number, default: APlayerOptionsDefault.volume },
mutex: { type: Boolean, default: APlayerOptionsDefault.mutex },
listFolded: { type: Boolean, default: APlayerOptionsDefault.listFolded },
listMaxHeight: {
type: String,
default: APlayerOptionsDefault.listMaxHeight,
},
lrcType: {
type: Number,
default: APlayerOptionsDefault.lrcType,
},
audio: {
type: [Object, Array],
required: true,
},
storageName: { type: String, default: APlayerOptionsDefault.storageName },
customAudioType: {
type: Object,
default: () => APlayerOptionsDefault.customAudioType,
},
customInit: {
type: Object,
default: () => APlayerOptionsDefault.customAudioType,
},
},
setup(props) {
const src = {
...props,
};
return () => h(APlayer, { src });
},
});