vue-aplayer demo
时间: 2023-08-18 12:06:47 浏览: 112
以下是使用vue-aplayer插件的示例代码:
引入依赖:
在项目中执行以下命令安装vue-aplayer插件:
npm install vue-aplayer --save
在组件中引入插件:
在需要使用vue-aplayer的组件中,通过import语句引入插件:
import Aplayer from 'vue-aplayer'
注册组件:
在组件的components选项中注册aplayer组件:
components: {
Aplayer
}
在模板中使用:
在模板中使用aplayer组件,并传入相应的参数:
<template>
<div>
<Aplayer autoplay :music="{ title: '剑心', artist: '张杰',***<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [Vue使用vue-apalyer实现音乐播放](https://blog.csdn.net/weixin_42707397/article/details/115394658)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *2* [vue-aplayer:一个基于vue2.x易于配置的音乐播放器控制组件](https://blog.csdn.net/weixin_34273481/article/details/88906750)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *3* [vue2.0 使用 vue-aplayer](https://blog.csdn.net/weixin_30487201/article/details/97350897)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文