Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

three-sphere

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-sphere

3d球

npmnpm
Version
1.0.12
Version published
Weekly downloads
18
200%
Maintainers
1
Weekly downloads
 
Created
Source

组件背景:用户在一定状态下弹窗提示

  • <NoOperate/>长时间未操作;停留在页面(30分钟)后未进行任何页面操作(例如点击、滚动、鼠标移动)等,弹窗提示用户。
  • <MultiUser/>多终端用户登录;当前账号在其他设备中登录,弹窗提示用户。

使用方法

npm install @tntd/user-status-modal --save

参数

参数作用
lang国际化`cn
modalShowEvent显示弹窗时回调。结合当前业务:如果未传此回调方法但传dispatch函数,默认执行 dispatch({ type: "login/signOut" });
modalCloseEvent关闭弹窗回调。结合当前业务:如果未传此回调方法但传dispatch函数,默认执行 dispatch({ type: "login/goLogin" });
noOperateTime停留页面时间设置,noOperate场景中可按照实际情况设置,默认30分钟
showModalmultiUser多终端登录时可以根据用户传递控制是否显示弹窗,默认弹窗
dispatch用于执行业务中的action
// 长时间未操作
<NoOperate
    lang="cn"
    noOperateTime="1000" // 静置时间
    modalShowEvent={()=>{ // 弹窗回调
        console.log(1)
    }}
    modalCloseEvent={()=>{ // 点击弹窗确定回调
        console.log(2)
    }}
/>

// 多终端登录
<MultiUser
    lang="cn"
    showModal={true}
    modalShowEvent={()=>{ // 弹窗回调
        console.log(1)
    }}
    modalCloseEvent={()=>{ // 点击弹窗确定回调
        console.log(2)
    }}
/>

FAQs

Package last updated on 11 Jun 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