-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue 3.0 compatibility #17
Comments
It was fixed in #23 . Currently to use this lib in vue 3 we have to:
|
Hi @cjblomqvist , I just open a PR which add the logic to handle both vue 2 and vue 3. |
Any updates on Vue3 support? If it is challenging to support, maybe use the 2.x release tree for vue2 and 3.x release tree for vue3? |
@ajmas There's no challenge at all. The code is ready since months but @euvl seems asleep... Take a look on linked PR for details. Waiting for @euvl wake up, I'm personally using my fork this way:
{
"dependencies": {
"v-clipboard": "https://github.com/M1CK431/v-clipboard"
}
}
import { createApp } from "vue";
import clipboard from "v-clipboard/src/index";
import App from "./App.vue";
const app = createApp(App);
app.use(clipboard); Hope it helps. |
I just ended up abandoning the use of this component and just used the API straight: onClickCopyToClipboard () {
const myText = 'blah';
navigator.clipboard.writeText(myText);
} I didn't really need more functionality than that. With a number of Vue related packages not being updated for Vue3, I am looking to see which ones really need updating and which ones can just be dropped for something more basic, like in this case. |
Be careful @ajmas, compat is not so good with this API, especially IE11: https://caniuse.com/?search=navigator.clipboard However, if your projet target decent browser version, you are probably free to go 😉 |
@M1CK431 Thanks for the info and I'll take that into consideration. and adjust accordingly. Right now the oldest MS browser we are targeting is Edge. At the same time https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard |
Thanks a lot for this documentation link, I was not aware about all that details. It will be excessively useful for anyone which would have to make a choice regarding how to implement clipboard related features 👌🏼 |
Currently v-clipboard doesn't work with Vue 3.0, which is now in RC and supposedly soon to be released.
The text was updated successfully, but these errors were encountered: