You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

775 B

order title debug
99 [{zh-CN 调试} {en-US Debug}] true

zh-CN

DEBUG

en-US

DEBUG

import { Affix, Button } from 'antd';

class Demo extends React.Component {
  state = {
    top: 10,
  };

  render() {
    return (
      <div style={{ height: 10000 }}>
        <div>Top</div>
        <Affix offsetTop={this.state.top}>
          <div style={{ background: 'red' }}>
            <Button
              type="primary"
              onClick={() => {
                this.setState({
                  top: this.state.top + 10,
                });
              }}
            >
              Affix top
            </Button>
          </div>
        </Affix>
        <div>Bottom</div>
      </div>
    );
  }
}

ReactDOM.render(<Demo />, mountNode);