How to add a button to copy displayed text in vue.js?
P粉297434909
P粉297434909 2024-03-28 12:57:15
0
1
466

I'm trying to add a button that will allow me to copy a snippet of code from a view to the clipboard of my code catalog application in vue.js.

When I use the vue clipboard library and try to do this in the example component:

<div class="full-screen-code-snippet">
  {{ example.codeSnippet }}
</div>

<div class="full-screen-copy-button">
<button v-clipboard:copy="example.codeSnippet"></button>    
</div>

The code snippet displays normally, but the button does not display. How is this going? How should I make this button?

P粉297434909
P粉297434909

reply all(1)
P粉509383150

You should use it like this: v-clipboard="variableName" or the same as :copy. You can here or this



sssccc
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template