nuxt-clipboard

A "copy to clipboard" module for Nuxt.js using vue-clipboard2
60,155 14
Install
npm install nuxt-clipboard
Latest Version:0.0.7
Vue:2
License:ISC
Last Updated:May 7, 2024
Links: GitHub  ·  npm
Maintainer: chantouchsek

Nuxt Clipboard

Latest Version on NPM Software License npm npm

A "copy to clipboard" module for Nuxt.js using vue-clipboard2

♻️ Setup

  • Add nuxt-clipboard dependency using yarn or npm to your project
  • Add nuxt-clipboard to modules section of nuxt.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

The MIT License (MIT)

Copyright (c) 2020 Chantouch Sek

Related Packages

nuxt-clipboard2

A "copy to clipboard" module for Nuxt.js using vue-clipboard2

101,299 21
vue3-copy

This is fork from egoist/v-copy and now support Vue 3.

1,158 1
v-clipboard

Vue.js Clipboard Plugin

1,101,981 515
@scalar/use-clipboard

tiny wrapper around the clipboard API

37,211 16,304
@meforma/vue-copy-to-clipboard

Vue.js 3 plugin to copy text to clipboard

16,239 12

Version History

Version Released License
0.0.7 ISC
0.0.6 ISC
0.0.5 ISC
0.0.4 ISC
0.0.3 ISC