Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[comp: Alert]: add Alert component #43

Closed
1 task done
FAKER-A opened this issue Dec 19, 2020 · 11 comments
Closed
1 task done

[comp: Alert]: add Alert component #43

FAKER-A opened this issue Dec 19, 2020 · 11 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@FAKER-A
Copy link
Contributor

FAKER-A commented Dec 19, 2020

  • 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 自定义关闭按钮 - -
@FAKER-A FAKER-A added the enhancement New feature or request label Dec 19, 2020
@danranVm
Copy link
Member

@644395781 @danranVm 负责此组件的 review, API 设计完成后请 @ 他们

@danranVm danranVm mentioned this issue Dec 20, 2020
95 tasks
@FAKER-A
Copy link
Contributor Author

FAKER-A commented Dec 21, 2020

@danranVm @644395781 老哥们 看下这个API。

@ssccchh
Copy link

ssccchh commented Dec 21, 2020

建议保留antd的showIconcloseText这个配置,不需要图标和自定义关闭按钮的场景还是存在的,并且你没有支持close的插槽,所以关于自定义关闭按钮这一块,建议提供一个自定义关闭按钮的配置。

@FAKER-A
Copy link
Contributor Author

FAKER-A commented Dec 21, 2020

建议保留antd的showIconcloseText这个配置,不需要图标和自定义关闭按钮的场景还是存在的,并且你没有支持close的插槽,所以关于自定义关闭按钮这一块,建议提供一个自定义关闭按钮的配置。

好的 , 加上了。showIcon 作为属性,closeText作为插槽。 @644395781

@ssccchh
Copy link

ssccchh commented Dec 21, 2020

closetext也用属性吧,已经处理了close的回调,而且基本上也都是会用类似关闭,我知道了等文案作为关闭按钮

好的 , 加上了。showIcon 作为属性,closeText作为插槽。 @644395781

@ssccchh
Copy link

ssccchh commented Dec 21, 2020

我的建议就这些,期待你的实现

@FAKER-A
Copy link
Contributor Author

FAKER-A commented Dec 21, 2020

closetext也用属性吧,已经处理了close的回调,而且基本上也都是会用类似关闭,我知道了等文案作为关闭按钮

好的 , 加上了。showIcon 作为属性,closeText作为插槽。 @644395781

这个再考虑一下吧,替换成关闭,我知道了 类似的文案的时候,一般会有特定的颜色。用户可能会需要自定义文本的颜色。

@FAKER-A
Copy link
Contributor Author

FAKER-A commented Dec 21, 2020

我的建议就这些,期待你的实现

😘

@danranVm
Copy link
Member

danranVm commented Dec 21, 2020

参数 说明 类型 全局配置
type 提示类型 success|info|warning|error info
message 提示内容 String | Slot -
description 提示的辅助性文字介绍 String | Slot -
closeable 是否显示关闭按钮 Boolean false
closeText 自定义关闭按钮 String | Slot -
banner 是否用作顶部公告 Boolean -
showIcon 是否显示辅助图标 Boolean false
icon 自定义图标,showIcon 为 true 时有效 String | Slot -
action 自定义操作项 Slot -
参数 说明 类型
close 关闭事件 (e: MouseEvent) => void

@danranVm
Copy link
Member

danranVm commented Dec 21, 2020

主要有以下几点建议:

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

@FAKER-A
Copy link
Contributor Author

FAKER-A commented Dec 21, 2020

主要有以下几点建议:

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

ok .那就去掉afterClose

@danranVm danranVm added this to the v1.0.0 milestone Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants