Vue.js: Business logic best practices?
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

This is not a coding task, but a request for an explanation/examples:

What is the Vue.js "best practice" for the location of business logic?

In AngularJS, we create service/factories to contain business logic and then reference it in components/controllers via dependency injections.

What is the equivalent to this in Vue?

Tags
vue-js

Crowdsource coding tasks.

1 Solution


In Vue.js there is no specific places to put your code part, you can use from single file to modular scructure.
Here is 2 articles to help you with the subject:

  1. How to setup Domain Driven Design (DDD) in a Vue.js app ?

https://oliverlundquist.com/2018/04/04/how-to-setup-ddd-in-vuejs-app.html

  1. Does DDD Belong on the Frontend? - Domain-Driven Design w/ TypeScript ?

https://khalilstemmler.com/articles/typescript-domain-driven-design/ddd-frontend/

If DDD is too much for your need check this:

https://medium.com/js-dojo/vue-js-architecture-for-large-scale-projects-7942dd3ce9f8