How To Add Copy To Clipboard Functionality In Vuejs With Prismjs?
I am displaying Html syntax using vue-prism-component (https://www.npmjs.com/package/vue-prism-component). Now I want to add a button that should copy the code. So far, I have foun
Solution 1:
Prism has some documentation for implementing such feature
https://prismjs.com/plugins/copy-to-clipboard/
Here is the example code for copying code from vue-prism-component
[Codepen] https://codepen.io/wilbo/pen/xRVLOj
You need to add this dependency of clipboard https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.12/clipboard.min.js
another codepen example which is not in vue but just to get idea
[Codepen] https://codepen.io/drhodes/pen/NAOgpG
Post a Comment for "How To Add Copy To Clipboard Functionality In Vuejs With Prismjs?"