MCPcopy
hub / github.com/xaboy/form-create / resetFields

Function resetFields

packages/core/src/frame/api.js:434–452  ·  view source on GitHub ↗
(fields)

Source from the content-addressed store, hash-verified

432 api.refresh();
433 },
434 resetFields(fields) {
435 tidyFields(fields).forEach(field => {
436 h.getCtxs(field).forEach(ctx => {
437 h.$render.clearCache(ctx);
438 ctx.rule.value = copy(ctx.defaultValue);
439 });
440 });
441 nextTick(() => {
442 nextTick(() => {
443 nextTick(() => {
444 api.clearValidateState(fields);
445 });
446 });
447 });
448 if (fields == null) {
449 is.Function(h.options.onReset) && invoke(() => h.options.onReset(api));
450 h.vm.emit('reset', api);
451 }
452 },
453 method(id, name) {
454 const el = api.el(id);
455 if (!el || !el[name])

Callers

nothing calls this directly

Calls 6

invokeFunction · 0.90
tidyFieldsFunction · 0.85
nextTickFunction · 0.85
emitMethod · 0.80
copyFunction · 0.70
clearValidateStateMethod · 0.65

Tested by

no test coverage detected