SevenOutman / vue-aplayer

:cake: Easy-to-use music player for Vue 2.x
https://vue-aplayer.js.org
MIT License
1.32k stars 200 forks source link

How to load again(reload) component in VueJs or destroy it and load again? #195

Open ali-hallaji opened 4 years ago

ali-hallaji commented 4 years ago

I have some issues with Aplayer and I create a post on Stackoverflow for it. Please help me. the link is here

SevenOutman commented 4 years ago

I have some issues with Aplayer and I create a post on Stackoverflow for it.

Please help me. the link is here

You can set a key prop on the component you want to re-create, and change its value to trigger the re-create.

Just FYI, this underlying mechanism is also how the key prop in lists works for caching components.

ali-hallaji commented 4 years ago

@SevenOutman Thank you so much for your plugin. But there are somethings is missing. I need to access my info's current music from Vue. For this approach, I forced to define refs then take it info from its and It's not reliable sometimes it plays music from the previous playlist when changing the list. But I think you know a better way. Also, I need to run triggers when the events happened.

ali-hallaji commented 4 years ago

I think there is a bug due to the component's computed property musicList being cached.