field.js 419 B

123456789101112131415161718192021222324
  1. export var FieldMixin = {
  2. inject: {
  3. vanField: {
  4. default: null
  5. }
  6. },
  7. watch: {
  8. value: function value() {
  9. var field = this.vanField;
  10. if (field) {
  11. field.resetValidation();
  12. field.validateWithTrigger('onChange');
  13. }
  14. }
  15. },
  16. created: function created() {
  17. var field = this.vanField;
  18. if (field && !field.children) {
  19. field.children = this;
  20. }
  21. }
  22. };