0

I have a problem with passing source to audio. I want to do it dynamically so i created state in vuex with path to file and when I pass source manually it work's but when pass source using store.state.currAlarm it shows an error: Cannot find module '../assets/Alarm1.mp3'. Yes I imported store and returned in setup() function.

<audio ref="audio" controls>
      <source :src="store.state.currAlarm" type="audio/mpeg">
    </audio>

Vuex

 state: {
        currAlarm: '../assets/Alarm1.mp3'
    },

Anyone can help to solve this problem?

  • 1
    Yeah I found there solution thank you!! For others the solution is: and change state in vuex to 'Alarm1.mp3' – maciek617 Apr 17 '22 at 18:12

0 Answers0