首先,我们先安装 npm install vue-aplayer --save ,之后在组件中引入 import VueAplayer from 'vue-aplayer',下面就是源码,可供参考: <template></template>importaxiosfrom'axios'importVueAplayerfrom'vue-aplayer'exportdefault{components: {//别忘了引入组件'a-player':VueAplayer}, data () {return{flag:f...
import type {PropType}from'@vue/runtime-core'; import {nextTick, onBeforeUnmount, onMounted, ref}from'vue'constplayerRef=ref() let instance: APlayer;// APlayer歌曲信息classAudio{// 音频艺术家artist: String;// 音频名称name: String;// 音频链接url: String;// 音频封面cover: String;// 歌词...
import {nextTick, onBeforeUnmount, onMounted, ref} from 'vue' const playerRef = ref() let instance: APlayer; // APlayer歌曲信息 class Audio { // 音频艺术家 artist: String; // 音频名称 name: String; // 音频链接 url: String; // 音频封面 cover: String; // 歌词 lrc: Strin...