vue-aplayeryer

安装

yarn add @moefe/vue-aplayer

使用

     <aplayer :audio="audio" :lrcType="3" fixed />
        

main

import APlayer from '@moefe/vue-aplayer';
Vue.use(APlayer, {
  defaultCover: 'https://github.com/u3u.png',
  productionTip: true,
});

js

  export default {
        name: "Vueaplayer",
        components: {

        },
        data() {
            return {
                audio: [{
                    name: '东西(Cover:林俊呈)',
                    artist: '纳豆',
                    url: 'http://localhost:8081/mp3/0003.mp3',
                    cover: 'https://p1.music.126.net/5zs7IvmLv7KahY3BFzUmrg==/109951163635241613.jpg?param=300y300', // prettier-ignore
                    lrc: 'https://cdn.moefe.org/music/lrc/thing.lrc',
                },
                    {
                        name: "0001",
                        artist: "0001",
                        url: 'http://localhost:8081/mp3/0001.mp3',
                        cover: "",
                        lrc: "[00:00.00]lrc here
[00:01.00]aplayer"
                    }
                ]

            }

        },
        
    }
原文地址:https://www.cnblogs.com/ouyangkai/p/13826812.html