1014156094 / vue-audio-player

Compact, simple and practical PC mobile audio player components(小巧简单实用的 PC 移动端的 Vue 音频播放器组件)
MIT License
201 stars 47 forks source link

Hiding volume bug #74

Closed carmmac closed 4 months ago

carmmac commented 4 months ago

Hi, found a bug using 2.0.3 version inside Nuxt3 project.

passing :show-volume-button="false"

throws an error TypeError: Cannot read properties of undefined (reading 'addEventListener')

at this.$refs.playVolumeWrap.addEventListener( 'touchmove', this.handleVolumePanmove, )

usage of the component

<VueAudioPlayer ref="audioPlayer"
          :audio-list="[{src: audio}]"
          theme-color="#BBAD9E"
          :show-play-loading="false"
          :show-volume-button="false"
          :show-playback-rate="false"
          :show-prev-button="false"
          :show-next-button="false"
        >
          <template #play-start>
            <BaseSvg icon="play" />
          </template>
          <template #play-pause>
            <BaseSvg icon="pause" />
          </template>
</VueAudioPlayer>

package.json

"@liripeng/vue-audio-player": "^2.0.3",

"nuxt": "^3.5.1",
1014156094 commented 4 months ago

The v2.0.4 version is fixed