A vuepress plugin for clipboard-copy
# install dependencies
npm i vuepress-plugin-one-click-copy -D
# or use yarn
yarn add vuepress-plugin-one-click-copy -D
Write vuepress config
module.exports = {
plugins: ['one-click-copy']
}
This plugin supports the following configurations.
module.exports = {
plugins: ['one-click-copy', {
copySelector: ['div[class*="language-"] pre', 'div[class*="aside-code"] aside'], // String or Array
copyMessage: 'Copied successfully!', // default is 'Copied successfully!'
toolTipMessage: 'Copy to clipboard', // default is ''Copy to clipboard'
duration: 300, // prompt message display time
}]
}
MIT.