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 reactivity on v-model (at least) with FormulateForm #164

Merged
merged 3 commits into from
Jul 9, 2020

Conversation

gahabeen
Copy link
Contributor

@gahabeen gahabeen commented Jul 8, 2020

This fixes a use case of mine as well as reported bug #108.

My use case is to have one object settings that is updated by several FormulateForm's.
Currently, the proxy wouldn't update which means that model would get reset with old values when updating another FormulateForm input.

With this fix the following code works:

<FormulateForm v-model="model" :schema="schema1">
<FormulateForm v-model="model" :schema="schema2">
export default {
  setup() {
    const model = ref({ a: true, b: false, c: false })
    const schema1 = [
      {
        type: 'checkbox',
        name: 'a',
        // ...
      },
      {
        type: 'checkbox',
        name: 'b',
        // ...
      },
    ]
    const schema1 = [
      {
        type: 'checkbox',
        name: 'a',
        // ...
      },
      {
        type: 'checkbox',
        name: 'c',
        // ...
      },
    ]
    return { model, schema1, schema2 }
  },
}

@justin-schroeder justin-schroeder changed the base branch from master to release/2.4.3 July 9, 2020 02:01
@justin-schroeder justin-schroeder merged commit d8318de into wearebraid:release/2.4.3 Jul 9, 2020
@justin-schroeder
Copy link
Member

This is dope @gahabeen 👍. Looks like a solid improvement, and I appreciate the test case to back it up. I merged this into the release/2.4.3. Was hoping to publish that earlier this week, but the bill-paying job has forced me to extend that timeline a bit. Either way, it'll see the light of day.

Kiitos 🙏

@gahabeen
Copy link
Contributor Author

gahabeen commented Jul 9, 2020

Nice! Don't worry, I've got my quick fix for now which works fine.

Tusen takk! (Now living in Norway, only been less than a week though 😅)

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.

2 participants