A vuepress plugin that copies code blocks with one click.
npm install @xiaopanda/vuepress-plugin-code-copy


> A VuePress plugin that copies code blocks with one click.
``bash`
yarn add -D @xiaopanda/vuepress-plugin-code-copyOR
npm install -D @xiaopanda/vuepress-plugin-code-copy
under .vuepress/config.js in the VuePress project:`js
module.exports = {
plugins: ['@xiaopanda/vuepress-plugin-code-copy']
}
`Options
This plugin takes a number of options, which can be configured in the options object under plugin:`js
module.exports = {
plugins: [
['@xiaopanda/vuepress-plugin-code-copy', {
buttonStaticIcon: Boolean,
buttonIconTitle: String,
buttonAlign: String,
buttonColor: String
}
]
]
}
`$3
* Type:
Boolean
* Default: falseThe copy button is only visible when hovers the mouse over the code block, or always visible.
$3
* Type:
String
* Default: CopyThe title content will appear when the mouse hovers over the copy button.
$3
* Type:
String
* Default: top
* Supported options: top or bottomThe copy button is aligned at the top-right or bottom-right corner of the code block.
$3
* Type:
String
* Default: #ffffff`The color of the copy button, you can set any Hex color codes.