0.0.7 • Published 4 years ago
nuxt-clipboard v0.0.7
Nuxt Clipboard
A "copy to clipboard" module for Nuxt.js using vue-clipboard2
♻️ Setup
- Add
nuxt-clipboarddependency using yarn or npm to your project - Add
nuxt-clipboardtomodulessection ofnuxt.config.js
export default {
modules: [
// simple usage
'nuxt-clipboard',
// with options
['nuxt-clipboard', { autoSetContainer: true }]
],
clipboard: {
autoSetContainer: true
}
}🔥 Usage
You can use $copyText in almost any context using app.$copyText or this.$copyText (Including store actions).
See vue-clipboard2 official docs for more usage information.
export default {
methods: {
async copySomething(text) {
try {
await this.$copyText(text);
} catch (e) {
console.error(e);
}
},
},
};License
Copyright (c) 2020 Chantouch Sek