dovy / vuepress-plugin-clipboard-copy

VuePress plugin for copying code blocks.
MIT License
3 stars 5 forks source link

Now using clipboard API + Added feedback #7

Open guaiamum opened 5 years ago

guaiamum commented 5 years ago
dovy commented 5 years ago

Will this work for all browsers? Don't want to code something that breaks the rest. ;)

guaiamum commented 5 years ago

The clipboard API is quite recent, but should work on most main browsers. https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#Browser_compatibility

I could add a polyfill with the old approach. How about make it into a Vue component that deals with it all?

dovy commented 5 years ago

Looks like not IE at all. Let's do a try/catch.

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#Browser_compatibility

guaiamum commented 5 years ago

Okay, don't you think is best to encapsulate this logic, Ui and styles into a Vue component, like this official plugin: https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/plugin-back-to-top?