Clipboard
Vue Bootstrap 5 Clipboard
The mdbClipboard
is a simple Vue directive which allows copying the given value to the user's clipboard.
Basic example
Attach v-mdb-clipboard
to button (or whatever you want
to be a trigger of copy to clipboard) and pass ref
from element (or v-model
) - for addition you got to add argument to directive which
matches to a name of variable with content. With inputs you got to add input
modyfier which is going after argument with name.
Note: This directive should be used together with normal script
syntax.
Copy from element
Copying from element (div
, p
or others) does not require adding modyfier (like input
).
Copy hardcoded value
By passing a string to v-mdb-clipboard
you can hardcode value to copy.
Feedback example
An example of triggering feedback using an alert and reference.