Comments (3)
Thanks @erkage will investigate
from formvuelate.
Hey @marina-mosti,
OMG...makes sense! I'd just overthink it and thought it's a complicated core issue 🙂 .
Thanks for checkin and big 👍 for the docs 🙂 .
from formvuelate.
Hey @erkage I found the problem. The solution is to change your condition to
return model.first?.second?.type2 === "C";
FormVueLate returns the model
as it currently is (unwrapped). This model is what you created using useSchemaForm
. Since there are no pre-defined values, neither first
nor second
exist yet in the model. Thus, you have to check first if these properties even exist in your function before trying out to check for an equality to a value C
.
The library doesn't deeply analyze the schema to pre-construct the model for you, it either constructs it lazily as the user fills the form, or uses as a template what you predefined in the useSchemaForm
model instantiation.
So another solution would be to state in your starting model:
const form = ref({
first: {
second: {}
}
});
from formvuelate.
Related Issues (20)
- Unexpected token with v3.6.0
- Locally imported components not working HOT 3
- Default values with value "false" are not added to model during initialisation HOT 1
- Load schema from json source HOT 2
- custom element for form HOT 1
- Wrap fields into a div inside form tag? HOT 2
- Using formvuelate + vee-validate one_of rule HOT 5
- Vue warns "inject() can only be used inside setup() or functional components." when trying to insert new object or array. HOT 3
- Add Support for (repeatable) Field Groups HOT 2
- Console warning with locally imported components
- Using local imports with Vee Validate plugin does not render form HOT 3
- codesandbox examples not working HOT 1
- Nested schemas with default values HOT 1
- Code sandbox is broken HOT 1
- How to trigger validate manually? HOT 6
- Unable to set validation for vee-validate HOT 2
- Expose or bind to change on validation meta and errors HOT 4
- Add custom class for each schema-row HOT 7
- Vue warns "provide() can only be used inside setup()" when calling "useSchemaForm()" inside a function.
- Dirrective
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formvuelate.