Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): deconstruct key cache value write back #4118

Conversation

panyu97py
Copy link

@panyu97py panyu97py commented Mar 25, 2024

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

修复在使用 JsonSchema 解构 key 时,数据回写为空的问题

//  表单实例
const form = createForm();

const schema = {
  a: {
    type: 'number',
    title: 'demo',
    'x-decorator': FormItem,
    'x-component': Radio.Group,
    'x-component-props': {
      options: [
        { label: '是', value: true },
        { label: '否', value: false },
      ],
    },
  },
  '{b,c}': {
    type: 'number',
    title: 'demo',
    'x-decorator': FormItem,
    'x-component': (props) => {
      const { value } = props;
      return (
        <div>
          <div>b:{value.b}</div>
          <div>c:{value.c}</div>
        </div>
      );
    },
    'x-reactions': (field: Field) => {
      const a = field.query('a').value();
      field.visible = Boolean(a);
    },
  },
};

const Demo = () => {
  useEffect(() => {
    setTimeout(()=>form.setValues({ a: true, b: 2, c: 3 }),500)
  }, []);

  return (
    <FormProvider form={form}>
      <SchemaField schema={billingInfoSchema} />
    </FormProvider>
  );
};

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


yu.pan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@panyu97py panyu97py changed the title fix:deconstruct key cache value write back fix(core): deconstruct key cache value write back Mar 25, 2024
@panyu97py panyu97py closed this Mar 25, 2024
@panyu97py panyu97py reopened this Mar 25, 2024
@panyu97py panyu97py closed this Mar 25, 2024
@panyu97py panyu97py reopened this Mar 25, 2024
@panyu97py panyu97py closed this Mar 25, 2024
@panyu97py panyu97py deleted the fix/deconstructKeyCacheWriteback branch March 25, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants