
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
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 87 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.