
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
bee-clipboard
Advanced tools
基于clipboard.js封装的复制组件
react bee-clipboard component for tinper-bee
复制组件
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|
| 42+ ✔ | 12+ ✔ | 41+ ✔ | 9+ ✔ | 29+ ✔ | 10+ ✔ |
import Clipboard from 'bee-clipboard';
class ClipboardDemo extends Component {
render() {
function success() {
console.log('success');
}
function error() {
console.log('error');
}
return (
<Clipboard action="copy" text="我将被复制到剪切板" success={success} error={error}>
</Clipboard>
)
}
}
<link rel="stylesheet" href="./node_modules/bee-clipboard/build/Clipboard.css">
import "./node_modules/bee-clipboard/src/Clipboard.scss"
//或是
import "./node_modules/bee-clipboard/build/Clipboard.css"
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| action | 方法,可以传copy或者cut,cut只支持textarea | string | copy |
| text | 要复制的文本内容 | string | - |
| target | 要复制内容的目标元素,可传选择器,如果选择器得出多个,会取第一个 | string/dom选择器 | - |
| success | 复制成功之后的回调函数 | function | - |
| error | 复制失败之后的回调函数 | function | - |
| locale | 设置默认文字语言 | object | 中文 |
通过给Clipboard组件设置locale语言对象。
如:
export default {
lang: 'zh-cn',
copy: '复制',
cut: '剪切',
copyReady: '已复制',
cutReady: '已剪切'
}
组件内默认中文,提供英文包。
import en from 'bee-clipboard/build/en_US.js';
$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-clipboard
$ cd bee-clipboard
$ npm install
$ npm run dev
FAQs
Clipboard ui component for react
The npm package bee-clipboard receives a total of 78 weekly downloads. As such, bee-clipboard popularity was classified as not popular.
We found that bee-clipboard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.