0.0.2 • Published 5 years ago
itelent-functional-zone v0.0.2
italent 功能区
- 简单悬浮、点击交互
- 点赞、收藏选中样式调整
- 点赞人数展示
- 使用
export default class Demo extends Component {
handleCommentClick = () => {
console.log("去评论");
};
handleRewardClick = () => {
console.log("去打赏");
};
handleBlessingClick = () => {
console.log("去送祝福");
};
handleCollectionClick = () => {
console.log("已收藏");
};
handleLikeClick = () => {
console.log("点赞");
};
render() {
const config = [
{
type: "blessing",//祝福
count: 3,
onClick: this.handleBlessingClick,
selected: false
},
{
type: "like",//点赞
count: 2,
onClick: this.handleLikeClick,
selected: false
},
{
type: "reward",//打赏
count: 2,
onClick: this.handleRewardClick,
selected: false
},
{
type: "collection",//收藏
count: 100,
onClick: this.handleCollectionClick,
selected: false
},
{
type: "comment",//评论
count: 1,
onClick: this.handleCommentClick,
selected: false
}
];
return <FunctionalZone config={config} />;
}
}
- 数据结构 要求
{
type: "comment",//功能类型
count: 1,
onClick: this.handleCommentClick,
selected: false
}