text #reactstrap #modal

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text #reactstrap #modal相关的知识,希望对你有一定的参考价值。

import React from 'react';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';

class Modal1 extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      modal: false
    };

    this.toggle = this.toggle.bind(this);
  }

  toggle() {
    this.setState({
      modal: !this.state.modal
    });
  }

  render() {
    return (
      <div>
        <Button color="danger" onClick={this.toggle}>{this.props.buttonLabel}</Button>
        <Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
          <ModalHeader toggle={this.toggle}>Modal title</ModalHeader>
          <ModalBody>
            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
          </ModalBody>
          <ModalFooter>
            <Button color="primary" onClick={this.toggle}>Do Something</Button>{' '}
            <Button color="secondary" onClick={this.toggle}>Cancel</Button>
          </ModalFooter>
        </Modal>
      </div>
    );
  }
}

export default Modal1;

以上是关于text #reactstrap #modal的主要内容,如果未能解决你的问题,请参考以下文章

React modal 使用 reactstrap 问题

如何在 React 功能组件中获取表单/提交以使用 ReactStrap?

如何将 ModalHeader 内的 ButtonDrowpdown 与 reactstrap 右对齐?

如何在 onClick 函数中将繁忙的光标添加到 reactstrap 模态按钮。该功能是一个承诺

text #reactstrap #index

text #reactstrap #progress