Code Monkey home page Code Monkey logo

Comments (2)

marina-mosti avatar marina-mosti commented on May 30, 2024

This I think can already be achieved by using a computed schema, where some sort of flag/ref on your code that keeps a count of how many users should appear updates the computed schema and more fields appear.

https://codesandbox.io/s/fvl-conditional-schema-with-schema-condition-3x-q7uoo

I don't think we can provide it out of the box on the schema as you suggest because that would more than likely have to assume some architecture, or we would have to provide an out of the box component to group the fields and allow the user to click to add more - which goes against the bring-you-own-components architecture of FormVueLate.

Formulate is different that way, and is very good at providing its own components.

Ill keep it in mind though in case I can figure out some manner of solution that requires no intermediate grouping component, but you should def be able to solve it with a computed :)

from formvuelate.

kishan93 avatar kishan93 commented on May 30, 2024

@marina-mosti I am generating multiple fields using a computed property

for (let i = 0; i < sizeCount.value; i++) {
...
  [
    {
            model: `size[${i}]['width']`,
            component: FormText,
            type: 'number',
            placeholder: 'Width(inches)',
            containerClass: 'col-span-3 mt-4 sm:col-span-1',
            validations: yup.number().required(),
    },
    {
        model: `size[${i}]['height']`,
        component: FormText,
        type: 'number',
        placeholder: 'Height(inches)',
        containerClass: 'col-span-3 mt-4 sm:col-span-1',
        validations: yup.number().required(),
    },
  ]
}
...

but I am facing difficulties storing those values in the model.
and also unable to remove an element at the specified index.

am I missing something ? is there another way to assign value to a model?

from formvuelate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.