import './demo7.css'; import Badge from '../index'; import React from 'react'; import ReactDOM from 'react-dom'; import { Button, Icon } from '@alifd/next'; const ButtonGroup = Button.Group; interface IState { count: number; show: boolean; } class Demo extends React.Component<{}, IState> { constructor(props) { super(props); this.state = { count: 0, show: true, }; this.increase = this.increase.bind(this); this.decrease = this.decrease.bind(this); this.onClick = this.onClick.bind(this); } increase() { const count = this.state.count + 1; this.setState({ count }); } decrease() { let count = this.state.count - 1; if (count < 0) { count = 0; } this.setState({ count }); } onClick() { this.setState({ show: !this.state.show, }); } render() { return (
unread messages {/* @ts-ignore */} unread messages
); } } ReactDOM.render(, document.getElementById('badge-demo-7'));