Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@txdfe/at-follow-dialog

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@txdfe/at-follow-dialog

AT业务组件 - 跟随对话框

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by160%
Maintainers
7
Weekly downloads
 
Created
Source

示例

import AtFollowDialog from '@txdfe/at-follow-dialog';
import { Button } from '@txdfe/at';

class Demo extends React.Component {
  state = {
    visible: false,
    currentStep: 'home',
  }

  toggleVisible = () => {
    this.setState({ visible: !this.state.visible });
  }

  render() {
    const { currentStep, visible } = this.state;
    return (
      <div className='example'>
        <Button
          onClick={this.toggleVisible}
          type="primary"
          id="targetDom"
        >
          Toggle visible
        </Button>
        <AtFollowDialog
          title="AtFollowDialog"
          visible={visible}
          target="targetDom"
          hasBackIcon={currentStep !== 'home'}
          onBackClick={() => this.setState({ currentStep: 'home' })}
          onRequestClose={this.toggleVisible}
          okText="提交"
          onOk={this.toggleVisible}
          align="tc bc"
          offset={[0, 8]}
        >
          {
            currentStep === 'home' &&
            <Button onClick={() => this.setState({ currentStep: '1' })}>next step</Button>
          }
          {
            currentStep === '1' &&
            <div>step 1</div>
          }
        </AtFollowDialog>
      </div>
    );
  }
}

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

API

参数类型可选值默认值是否必填说明
visibleBooleantrue/falsefalse控制对话框是否展示,传递trigger时优先使用trigger
triggerReactNode触发元素
titleReactNode/String标题
targetnull对话框目标元素,可以是id,也可以是ref。
okTextString确定底部确认按钮文字
onOkFunc确认按钮点击,不传递时不展示确认按钮
noBodyPaddingBooleantrue/falsefalsebody区域是否有padding
onRequestCloseFunc关闭对话框函数
onVisibleChangeFunc组件visible改变时回调
okDisabledBoolean确认按钮是否禁用
okWarningBooleanfalse确认按钮是否warning
okTypenormal, primaryprimary确认按钮type
onBackClickFunc设置hasBackIcon时 返回按钮的点击
hasBackIconBooleantrue/falsefalse是否展示返回按钮
alignString参考Overlay
offset参考Overlay
container参考Overlay
hasMask参考Overlay
disableScroll参考Overlay
shouldUpdatePosition参考Overlay

FAQs

Package last updated on 06 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc