mip-extensions icon indicating copy to clipboard operation
mip-extensions copied to clipboard

mip-form 组件优化

Open xuexb opened this issue 6 years ago • 5 comments

问题分类

  • MIP 组件使用

问题描述

  1. 需要检查原生的 <form> 元素支持的参数,应该被透传
  2. 需要同原生的 <form> 元素的默认属性一致,比如 novalidatetargetautocomplete 等,强烈建议把现有的 <mip-form> 废了/重构
  3. 表单元素向原生态健康品靠拢,如 <input required accesskey="s" autocomplete="new-password" autosave formmethod="post" list="list" pattern="test" placeholder="占位" tabindex="0"> ,且打破必须嵌入到 <mip-form> 中的规则
  4. <input> 的类型参数使用 validatetype 而不是 type
  5. <input> 的验证正则使用 validatereg 而不是 pattern
  6. <input> 的必选属性使用 validatetype="must" 而不是 required
  7. 没有使用 <mip-form> 是否支持 target 的属性,场景是需要在当前窗口跳转,代码: https://github.com/mipengine/mip-extensions/blob/master/src/mip-form/mip-form-fn.js#L118
  8. 只是一个单纯的表单元素(如 <input> )必须由 <mip-form> 嵌套,而场景是不想引用 <mip-form>
  9. 真心不懂为什么 <mip-form> 会自动光环(样式) ,因此影响了表单内部的样式:

https://github.com/mipengine/mip-extensions/blob/8b1ec770aef50654a49fbaf88f9b7fac99cc7b47/src/mip-form/mip-form.less#L17-L51

我想很多人现在需要覆盖样式才能正常使用,如覆盖这个:

mip-form div { 
     display: none; 
}

参考:

xuexb avatar Mar 21 '18 10:03 xuexb

#1029

xuexb avatar Mar 27 '18 02:03 xuexb

@VenyXiong FORM组件需要进行重新设计来满足组件的易用性,计划下周给出具体的设计方案。

tayqassqan avatar Mar 27 '18 08:03 tayqassqan

哇 终于找到有聊到mip-form这个笔玩意的地方了 这东西有毒吧 啊? 本来我就菜 开发全靠bootstrap维持生活 现在一导入这个玩意 把我样式全搞乱了 我勒个去啊 能不能本本分分的做一个from啊 嫩是要搞那么多讨论 坑死我了

o2e avatar Jun 03 '18 12:06 o2e

能不能本本分分的做一个 from

😂

xuexb avatar Jun 03 '18 14:06 xuexb

mip-form 表单提交后返回的json格式是怎样的? 不知道怎么触发success,另外提交后表单清空的问题

realyrare avatar Jun 08 '18 06:06 realyrare