Can you use v-if's using the schema generator.
See original GitHub issueIs it possible to use v-if’s when generating forms with the schema.
Obviously you can use something like below if you were using the templates but ideally would prefer to be able to use it with the schema generator
<template> <FormulateInput v-if="foo" type="text" v-model="myModel" /> </template>
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (8 by maintainers)
Top Results From Across the Web
Video SEO Schema Generator Plugin
Video SEO Schema Generator Plugin. In this topic, you will learn how to use a plugin that generates a video schema for SEO....
Read more >Schema Markup - The ONLY Guide You Need To Read in 2022
Using the built-in Schema Generator, you can also add multiple Schema types to a page – and this is still very easy –...
Read more >Specifying a schema | BigQuery - Google Cloud
After you create your JSON schema file, you can specify it using the bq command-line tool. You can't use a schema file with...
Read more >Schema - What It Is & How to Add It to Your Site | WP Engine®
Learn how to use JSON-LD schema to improve your site's SEO. ... regardless of which schema type or format you use to generate...
Read more >Google Video Schema Markup Generator
It uses video specific structured data on the page to understand more about the ... You can also reference videos in How-to and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Assay of Conditionals in Other Libraries
vue-form-json-schema
Has a [very verbose] way of handling this: Dynamic Options Example on Code Sandbox
Blitzar BlitzForm
A newer form generation library that puts expressions in the JSON: Docs: Dynamic Prop Based on the Value of Another Field
and right after that: Show or Hide a Field Based on Another Field
FormVueLate
Doesn’t bring any form field components, but has validator plugins, schema, form model, etc. Docs: Conditionally displaying an element within the schema codesandbox
NCForm
Uses the concept of “dx expressions”
disabled: 'dx: {{$root.person.age}} < 18'
vjsf
Conditional content using valid json, to create a “pseudo language” with if/else/then.
VueJS Generators
Another pretty limited library, but they are also putting expression in the JSON, for better or worse, for visible, disabled, readonly and featured(?) proeprties: Docs: Dynamic Visibility
Alpaca Forms
This doesn’t use Vue but it’s an oldie that I thought I’d include. I’ll probably find some React-forms libraries’ examples later too. Alpaca uses JSON Schema Dependencies. Docs: Alpaca Conditional Dependencies Docs: Alpaca Dependencies Docs: JSON Schema Dependencies
The dependency is set on the triggered (shown/hidden) field, referencing the triggering field. The dependencies for enumerables appear to require setting the dependency in the schema of the fields as well as in the options.
It also appears they don’t support “if date is between”, “if this field is X and that other field is Y”. They just support “show this field if this other field(s) values are …”
Hope these help and spark some ideas and discussion!
Vue Formulate is the best library I’ve found for flexibility of custom components, validation, plugins, lack of verbosity, and thoughtfulness. I want schema-based form generation to be a first-class citizen. Our forms’ definitions are stored in a database, so they’re all dynamic, so the template options don’t work for us. By virtue of a URL, I need to dynamically load the right form definition from the server: no hand-crafting form templates.
Inspections: “Does this facility perform surgery?” : then show a bunch of surgery questions about surgery.
Medical Doctor License Applications: “Felony record in the past year?” " then require/display fields asking for explanation and upload documents.
Employment History: Repeater groups of fields for unlimited history. If gap in dates > 6 months: then ask for explanation. …
Very much so. FormKit uses a nearly Turing complete schema 😃