1、中文文档地址: https://github.com/SevenOutman/vue-aplayer/blob/develop/docs/README.zh-CN.md#%E9%9F%B3%E4%B9%90%E4%BF%A1%E6%81%AF
2、安装:
npm i vue-aplayer -S
npm i hls.js -S // 如果安装vue-aplayer报错,则需要安装 hls.js 依赖
3、引入
import Aplayer from 'vue-aplayer'
new Vue({
components: {
Aplayer
}
})
4、使用
<aplayer
autoplay // 自动播放
:music="{
theme:'1890FF', // 主题颜色,theme 值设为 'pic', Vue-APlayer 会从它的封面图片中提取颜色作为主题色
title: '标题', // 音乐名
artist: 'Silent Siren', // 作者
src: 'http://96.ierge.cn/14/220/440580.mp3?v=0524', // 音乐路径
pic: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.jpg'// 封面图,可传可不传
}"
/>
5、属性