Comments (5)
I do include one simple implementation in login.vue
. Is that the kind of thing you're looking for?
from vue-enterprise-boilerplate.
I was talking about a more robust way to handle form data through vuex. There are some solutions out there but not sure any of them are active. I might start my own OS project for it.
Even without a plugin, when forms get complex (aka using many nested components) validation gets tricky, storing the data in the parent component state also gets tough.
This is one thing that most boilerplates miss is showing real, complex forms (often partially populated via ajax etc).
I just refactored a form into vuex that ended up being about 5-10 components and is quite complex so I just recently felt this pain.
It seems that there isn't many examples of this kind of thing using vuex online. I'd love to help contribute to it in some way if you're interested in adding something like this (even as a non working example) to the boilerplate.
I do see a strong potential for developing a lightweight, robust form handling library built on vuex that handles validation and form data gathering (into a temporary forms[this.form.name] endpoint on vuex.
What do you think?
from vue-enterprise-boilerplate.
There are definitely some patterns that can help with complex forms, but I've usually found the exact needs and nature of the complexity can vary a lot between projects, so there's not really a 1-size-fits-all solution that I can recommend unfortunately.
In the case of forms built out of many nested components, I often see people break up a form component into many smaller, nested components just because the original form component was getting big. There isn't really anything wrong with a big component though. As long as it's not becoming a pain to maintain, it can stay big. I've seen people create a lot of work for themselves by splitting up a single concern into many deeply coupled components that have to constantly communicate. It's sort of like a recipe with 20 ingredients - it might seem like a lot, but introducing 20 chefs to "simplify" it will just make it 20 times more complex. 😄
I'm not sure if that's at all relevant to your case though. It's difficult to give advice without the code and like I said, there isn't really a pattern that's appropriate for everyone. For that reason, I don't think it meets the requirements to be added to the boilerplate unfortunately.
from vue-enterprise-boilerplate.
That is an interesting point. So do you generally keep forms in a single component even if they might be hundreds to thousands of lines long, with sub collection modification etc?
I can see an argument to be made to perhaps only create components for input level stuff within a form, keeping it one to two levels deep instead of more.
from vue-enterprise-boilerplate.
I'll keep a component long if I feel its complexity is still pretty low and so not very difficult to maintain - and there are also other ways to shorten form components other than splitting them out into subcomponents. For example, render functions can be pretty useful in creating dynamic form generators, sometimes even automatically by analyzing the data that it's binding to.
from vue-enterprise-boilerplate.
Related Issues (20)
- Stylelint error on fresh install
- compile problem related to new source HOT 1
- Relative imports from parent directories are not allowed. HOT 2
- pre-commit doesn't do anything ! HOT 2
- Error Test in E2E
- Add template feature to repo?
- Failed Netlify deploy
- Error in test unit. something wrong with config, maybe HOT 1
- Will we update this boilerplate to vue3? HOT 3
- Where can I find examples of using this boilerplate? HOT 1
- sass-loader unable to load from updated .scss files
- Dependency Injection into Vuex Modules HOT 3
- Is this a typo or intentional? HOT 1
- TypeError: ext[key].bind is not a function HOT 3
- Getting issue while importing new component and not getting type suggestion HOT 1
- Problem setting environment variable API_BASE_URL HOT 1
- Change app.config.json at runtime
- Where do I set backend url for production?
- After "yarn upgrade" it breaks :( - Windows 10 HOT 1
- Updated dependencies release?
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 vue-enterprise-boilerplate.