Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@txdfe/at-collect
Advanced tools
收藏组件,一个小星星。
import Collect from '@txdfe/at-collect';
class Demo extends React.Component {
state = {
collected: false,
collected1: false,
collected2: false,
collected3: false,
collected4: false,
};
onClick = () => {
this.setState({
collected: !this.state.collected
});
};
onClick1 = () => {
this.setState({
collected1: !this.state.collected1
});
};
onClick2 = () => {
this.setState({
collected2: !this.state.collected2
});
};
onClick3 = () => {
this.setState({
collected3: !this.state.collected3
});
};
onClick4 = () => {
this.setState({
collected4: !this.state.collected4
});
};
render() {
return (
<div>
<Collect
collected={this.state.collected}
onClick={this.onClick}
/>
<Collect
language="en-us"
collected={this.state.collected1}
onClick={this.onClick1}
/>
<Collect
collected={this.state.collected3}
onClick={this.onClick3}
hoverCollectedText="hover收藏"
hoverUncollectedText="hover取消收藏"
/>
<Collect
language="en-us"
type="button"
collected={this.state.collected2}
onClick={this.onClick2}
/>
<Collect
type="button"
collected={this.state.collected4}
buttonCollectedText="收藏了"
buttonUncollectedText="还没有收藏"
onClick={this.onClick4}
/>
</div>
);
}
}
ReactDOM.render(<Demo />, mountNode);
参数 | 类型 | 可选值 | 默认值 | 说明 |
---|---|---|---|---|
collected | bool | true/false | false | 是否收藏 |
onClick | function | () => {} | 点击回调 | |
type | 枚举值 | icon, button | icon | icon模式或button模式 |
language | string | zh-cn, en-us | zh-cn | 选择语言 |
hoverCollectedText | string | 无 | 收藏状态下icon模式hover文案,设置了这个参数,language就会失效 | |
hoverUncollectedText | string | 无 | 未收藏状态下icon模式hover文案,设置了这个参数,language就会失效 | |
buttonCollectedText | string | 无 | 收藏状态下button模式文案,设置了这个参数,language就会失效 | |
buttonUncollectedText | string | 无 | 未收藏状态下button模式文案,设置了这个参数,language就会失效 |
FAQs
AT业务组件 - 收藏
The npm package @txdfe/at-collect receives a total of 5 weekly downloads. As such, @txdfe/at-collect popularity was classified as not popular.
We found that @txdfe/at-collect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.