such icon indicating copy to clipboard operation
such copied to clipboard

Should the `:ref` support reference a field appear after the current field?

Open fefit opened this issue 3 years ago • 0 comments

Such.as({
  a: ":string",
  b: ":ref:&./a"
});

The above example will worked fine, because the field "b" reference the field "a" is appeared before itself.

But when you changed the field's position:

// exchange the position of field 'a' and 'b'
Such.as({
  b: ":ref:&./a"
  a: ":string",
});

It will cause an error because the reference field 'a' is not generated a data yet. This may not friendly experience, but it's easy to code the logic for the library and most time you can just type the field 'a' before field 'b' to avoid this problem.

So do you think there are some scenes it's better or valuable to support that thing ?

fefit avatar Feb 12 '22 03:02 fefit