分类 前端技术 下的文章

问题

  • 在使用 $.val() 对一个input进行赋值时,只会解决 onchange事件
  • 在使用 v-on:change 对该事件进行绑定时,发现无法监听到 change 事件
  • v-model使用的是 input 事件而不是 change 导致 v-model 无法正常工作

解决办法

v-model 可以解决, 只需要在 change 事件中 触发一下 input 事件就好了。

$('#expire-date').on('change', function () {
  this.dispatchEvent(new Event('input'))
})

react-schema-form

  1. Design with no theme, Has Core Package and Bootstrap package ↑↑
  2. The size of the file after compile is small ↑
  3. Not a stable package ↓
  4. Easy to implement ↑
  5. If field is empty, props in form-data is deleted. ↑
  6. When field is hide, props in form-data is visible. ↓
  7. Custom template is easy ↑↑
  8. Some default template break the style of custom template ↓

React-jsons-form

  1. Design with material-ui ↓
  2. The size of the file after compile is large↓
  3. Stable package ↑
  4. Easy to implement ↑
  5. If field is empty, props in form-data is an empty string ↓
  6. When field is hide, props in form-data is visible ↓
  7. Custom Template is easy ↑
  8. but hard to overwrite default template ↓