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

refactor messagebox components #479

Open
29 of 30 tasks
JerryWu1234 opened this issue Dec 14, 2020 · 0 comments
Open
29 of 30 tasks

refactor messagebox components #479

JerryWu1234 opened this issue Dec 14, 2020 · 0 comments
Labels
refactor Refactor old code

Comments

@JerryWu1234
Copy link
Contributor

JerryWu1234 commented Dec 14, 2020

重构组件规范

Tasking

messageBox组件

  • 调用modal窗功能
  • title控制messageBox的标题,不传默认为Null
  • message控制messageBox的内容,支持VNode和string,
  • dangerouslyUseHTMLString是否将 message 属性作为 HTML 片段处理,默认为false
  • type控制messageBox的消息类型,用于显示图标,默认值[success|info|warning|error]
  • iconClass自定义messageBox图标的类名,会覆盖 type属性
  • customClassMessageBox 的自定义类名
  • callbackmessageBox若不使用 Promise,可以使用此参数指定 MessageBox 关闭后的回调,回单函数参数,(action:confirm|cancel|close,instance:messageBox)=>{},当前的实例,
  • showClose是否展示messageBox又上角的关闭按钮,默认为true
  • beforeClose messageBox关闭前的回调,会暂停实例的关闭,(action:confirm|cancel|close,instance:messageBox,done)=>{} done用于关闭messageBox的实例
  • distinguishCancelAndClose 是否将取消(点击取消按钮)与关闭(点击关闭按钮或遮罩层、按下 ESC 键)进行区分 默认值为false
  • lockScroll 是否在 MessageBox 出现时将 body 滚动锁定默认为true
  • showCancelButton是否显示取消按钮,默认为false,以 confirm 和 prompt 方式调用时为 true
  • showConfirmButton是否显示确定按钮,默认为true
  • cancelButtonText取消按钮的文本内容, 默认为取消
  • confirmButtonText 确定按钮的文本内容, 默认为确定
  • cancelButtonClass 取消按钮的自定义类名
  • confirmButtonClass 确定按钮的自定义类名
  • closeOnClickModal 是否可通过点击遮罩关闭 MessageBox, 默认为true,以 alert 方式调用时为 false)
  • closeOnPressEscape 是否可通过按下 ESC 键关闭 MessageBox,默认为true,以 alert 方式调用时为 false
  • closeOnHashChange 是否在 hashchange 时关闭 MessageBox 默认为true
  • showInput是否显示输入框,默认为false,以 prompt 方式调用时为 true
  • inputPlaceholder输入框的占位符
  • inputType输入框的类型,默认为text
  • inputValue输入框的初始文本
  • inputPattern输入框的校验表达式
  • inputValidator输入框的校验函数。可以返回布尔值或字符串,若返回一个字符串, 则返回结果会被赋值给 inputErrorMessage
  • inputErrorMessage校验未通过时的提示文本,默认为"输入的数据不合法!"
  • center是否居中布局,默认为false
  • roundButton 是否使用圆角按钮
@cuixiaorui cuixiaorui added the refactor Refactor old code label Dec 14, 2020
JerryWu1234 added a commit to JerryWu1234/element3 that referenced this issue Dec 25, 2020
Refactor(messagebox):finish refactor messagebox component hug-sun#479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor old code
Projects
None yet
Development

No branches or pull requests

2 participants