Skip to content

Changes to support Vue3#82

Open
ainarend wants to merge 2 commits intoanteriovieira:masterfrom
ainarend:master
Open

Changes to support Vue3#82
ainarend wants to merge 2 commits intoanteriovieira:masterfrom
ainarend:master

Conversation

@ainarend
Copy link
Copy Markdown

@ainarend ainarend commented Jul 19, 2021

Here are the necessary changes to the vue-youtube for it to work with Vue3.

Ignore the changes to the ./dist folder, I made those for my own project so I could continue using the component while the package gets updated, as I was unable to quickly get the rollup build to work with vue#. But Vue3 drops the support for older browsers anyway, so worth thinking about which bundles are needed.

Important changes are these:

  • beforeDestroy -> beforeUnmount
  • instead of render(h) { return h('div'); } using render () { return h('div') } and import { h } from 'vue'
  • Use @vue/compiler-sfc instead of vue-template-compiler
  • src/index.js changes for the plugin() method to install the plugin globally (not tested, as I am not using the plugin globally)

I guess this should be a tagged release in a new major version to keep the vue2 release as well.

Oh, and a side note on using the fork/PR version already. When using the plugin locally in components, i was using it in vue2 like this:
import { Youtube } from 'vue-youtube';
but since i did not use the rollup to do the release, rather just copied the component to dist as modern browsers can handle it, then you can use the component locally like this:
import Youtube from 'vue-youtube';

@komali2
Copy link
Copy Markdown

komali2 commented Oct 21, 2021

@anteriovieira sup

@MaxKorlaar
Copy link
Copy Markdown

I'd love to see this PR get merged, even in 2023 :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants