## 音频播放
<br />

### 基本用法

:::demo 
```html
<template>
    <div>
        <button @click='play'>播放</button>
        <button @click='pause'>暂停</button>
        <button @click='rePlay'>重播</button>
        <ve-audio :src="src" ref="audio" @ended='ended' @play='onplay' @pause='onpause' @error='error'/>
    </div>
</template>
<script>
export default {
    data() {
        return {
            src: "http://nicelooweb02.oss-cn-qingdao.aliyuncs.com/examAudio/优路教育题库/一级消防工程师/综合能力/1月8-9日2015综合能力课程/1月9日2015消防综合能力课程69.mpg.asc.mp3",
        }
   },
   methods: {
        play(){
            this.$refs.audio.play();
        },
        pause(){
            this.$refs.audio.pause();
        },
        rePlay(){
            this.$refs.audio.rePlay();
        },
        onplay(){
            console.log('播放开始啦')
        },
        ended(){
            console.log('播放完啦')
        },
        onpause(){
            console.log('暂停啦')
        },
        error(error){
            console.log(error)
        }
    }
 };
</script>
```
:::


### Attributes
| 参数      | 说明          | 类型      | 可选值                           | 默认值  |
|---------- |-------------- |---------- |--------------------------------  |-------- |
| src     |  音频路径           | string | — | — |

### Events

| 事件名称 | 说明 | 回调参数 |
|---------- |-------- |---------- |
| ended | 播放完触发的事件 | — |
| play | 播放开始触发的事件 | — |
| pause | 暂停触发的事件 | — |
| error | 播放异常触发的事件 | — |
