Skip to content

vxhly/vuepress-plugin-one-click-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vuepress-plugin-one-click-copy

A vuepress plugin for clipboard-copy

npm GitHub stars GitHub license

Install

# install dependencies
npm i vuepress-plugin-one-click-copy -D

# or use yarn
yarn add vuepress-plugin-one-click-copy -D

Usage

Write vuepress config

module.exports = {
  plugins: ['one-click-copy']
}

Options

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
  }]
}

License

MIT.