Open ahmedh01 opened 3 years ago
same here
I think migrating this to Vue3 is pretty easy:
beforeDestroy
-> beforeUnmount
render() { return Vue.h('div'); }
instead of render(h) { return h('div'); }
I will migrate to version 3 soon.
Any ETA for migrating to vue 3 ?
Also looking forward to getting Vue 3 support. Did anyone found a workaround in the meantime?
I just injected the api js as a workaround.
setup(props, context) {
var tag = document.createElement('script')
tag.src = 'http://www.youtube.com/iframe_api'
const firstScriptTag = document.getElementsByTagName('script')[0]
firstScriptTag.parentNode?.insertBefore(tag, firstScriptTag)
}
Then you can assign player= new YT.player and use its api. details at my repo: https://github.com/jameshwc/Million-Singer-Vue-Frontend/blob/main/src/views/Song.vue
I created a PR with the changes necessary to get it working with Vue3: https://github.com/anteriovieira/vue-youtube/pull/82
I did not have time to fully dive into to the rollup setup, so ignore the changes i made in the PR to the /dist folder, i made those only to get the component working for my own project.
Published a lightweight component that works with both Vue 2/3
Running into the following issue trying to use
vue-youtube
on Vue 3 RCInstalled
vue-youtube
vianpm
, and imported it into my project globally inmain.js
following the directions given by the Vue 3 docs.main.js
In the console, I get the following error:
Might be something minor?