## 安装 ### Node ``` $ yarn add vue-aplayer ``` 或者如果你选择 `npm` ``` $ npm i vue-aplayer ``` ### CDN ```html ``` ## 运行时要求 - [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) - [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) ## 使用 ```HTML ``` ```JS // ES6 import Aplayer from 'vue-aplayer' new Vue({ components: { Aplayer } }) ``` ### Props | 名称 | 类型 | 默认值 | 说明 | | ---- | ---- | ------- | ----------- | | music| Object | *必需* | 当前播放的音乐。 具体请看[音乐信息](https://github.com/SevenOutman/vue-aplayer/blob/develop/docs/README.zh-CN.md#音乐信息) | | list | Array | `[]` | 播放列表。如果 list 不是空数组,播放列表就会显示出来,即使 list 中只有一首歌并且它和 music 一样 | | mini | Boolean | `false` | 迷你模式 | | float | Boolean | `false` | 浮动模式。你可以在页面上随意拖放你的播放器 | | showLrc | Boolean | `false` | 是否显示歌词 | | mutex | Boolean | `true` | 是否在该播放器播放时暂停其他播放器 | | theme | String | `'#41b883'` | 主题色。如果当前歌曲也设置了 `theme` 则以歌曲的为准 | | shuffle | Boolean | `false` | 随机播放 | | repeat | String | `'no-repeat'` | 轮播模式。值可以是 `'repeat-one'`(单曲循环)`'repeat-all'`(列表循环)或者 `'no-repeat'`(不循环)。为了好记,还可以使用对应的 `'music'` `'list'` `'none'` | | listMaxHeight | String | *none* | 播放列表面板最大高度 | | listFolded | Boolean | `false` | 默认收起播放列表 | | narrow | | | DEPRECATED, 请使用 `mini` | | listmaxheight | | | DEPRECATED, 请使用 `listMaxHeight` | | showlrc | | | DEPRECATED, 请使用 `showLrc` | > 如果你是用的是 Vue@2.3.0+, 你可以在 `music` `shuffle` 和 `repeat` 上使用 [`.sync` 修饰符](https://cn.vuejs.org/v2/guide/components.html#sync-%E4%BF%AE%E9%A5%B0%E7%AC%A6)。 ### 将 Audio 属性作为 props 从 `v1.4.0` 开始,我们选取了一些 `