4 ms·
Ask HN: What should be the maximal lines size of a vue.js single file component?
- jppope 7y agoA SFC should do a single thing well. Check out atomic design, it might help you :) http://bradfrost.com/blog/post/atomic-web-design/ http://bradfrost.com/blog/post/atomic-web-design/
- eyegor 7y agoI don't think LOC is a good measure of complexity (which is typically what LOC limits are trying to stop). Generally I try to split things up once the component is trying to accomplish multiple tasks that could be separated. So something that handles the file upload API probably shouldn't contain oauth checks, instead calling an oauth component, separate business logic from domain logic, etc. Typically this ends up limiting them to ~500 LOC, but that's just a coincidence.