question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[comp: Alert]: add Alert component

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

What does the proposed API look like?

props

参数 说明 类型 默认值
message 提示内容 String -
description 提示的辅助性文字介绍 String -
type 提示类型 successinfowarningerror String info, banner模式下默认值为warning
closeable 是否显示关闭按钮 Boolean false
banner 是否用作顶部公告 Boolean false
showIcon 是否显示辅助图标 Boolean false,banner 模式下默认值为 true

事件

参数 说明 类型 默认值
onClose 关闭事件 Function -
afterClose 关闭动画结束后触发的事件 Function -

slot

参数 说明 类型 默认值
action 自定义操作项 - -
message 提示内容 - -
description 辅助性介绍 - -
icon 自定义图标 - -
closeText 自定义关闭按钮 - -

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
FAKER-Acommented, Dec 21, 2020

主要有以下几点建议:

  • 默认值使用全局配置替换,参见 useGlobalConfig
  • closeText 支持 props 的方式,传入一个普通文本
  • icon 支持 props 的方式,实现上使用 ix-icon 组件即可
  • onClose 更改为 close
  • afterClose 需要在考虑以下是否有必要实现
  • prop 和 slot的文档合并一下,在类型一栏标记清楚即可

ok .那就去掉afterClose

0reactions
danranVmcommented, Dec 21, 2020

主要有以下几点建议:

  • 默认值使用全局配置替换,参见 useGlobalConfig
  • closeText 支持 props 的方式,传入一个普通文本
  • icon 支持 props 的方式,实现上使用 ix-icon 组件即可
  • onClose 更改为 close
  • afterClose 需要在考虑以下是否有必要实现
  • prop 和 slot的文档合并一下,在类型一栏标记清楚即可
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Alert Component in ReactJS? - GeeksforGeeks
We can use Alert Component in ReactJS using the following approach. Creating React Application And Installing Module:.
Read more >
How to Build a Custom Alert Component Using SvelteKit and ...
https://everythingsvelte.com/ ; 00:00 - Intro ; 01:20 - SvelteKit Project Setup with Tailwind CSS ; 05:15 - Run the SvelteKit Project ; 05:35...
Read more >
React : Firing a custom alert from multiple components using ...
React : Firing a custom alert from multiple components using an existing component having its own styles ; <span className='text-xl inline-block ...
Read more >
Create a custom React alert message - LogRocket Blog
Review popular frameworks for building alert messages in React, then build your own custom alert message from scratch.
Read more >
Alerts - Bootstrap
Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found