简体   繁体   English

在 antd 中显示应用程序令牌的模态

[英]Modal for showing application token in antd

I am creating an application in which you can create API tokens just like PAT tokens in github. I want to show them just once.我正在创建一个应用程序,您可以在其中创建 API 令牌,就像 github 中的 PAT 令牌一样。我只想展示一次。 For showing them I am using a Modal component.为了向他们展示我正在使用模态组件。 How can I trigger the modal to show token details once the api request for generating token is completed.生成令牌的 api 请求完成后,如何触发模式以显示令牌详细信息。

  1. You can create a state that will be initialized as null您可以创建一个 state,它将被初始化为 null
  2. When the token was created, you can store the details of the token in the state创建令牌时,您可以将令牌的详细信息存储在 state
  3. Render the modal conditionally based on the state.根据 state 有条件地渲染模态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM