a template or starting point you can say, for crafting vue js application.
Directory stracture
For static assets like images.
For global/generic/common components which will be available across the application. After creating a component you can add it to components/index.js. Note it is only for global component.
For layout files. Layout file must include component. Which is a global component. Layouts can be included with layout: 'layoutName' . Example:
// layouts/auth.vue
//in code
<script>
export default {
...
layout: 'auth'
}
</script>
Basic middleware stuff.
Basic vue mixing.
Modules is sort of a replica of a mini vue app. Containing pages, components, services, routes, state, api routes etc within. It has three bindings possibilites.
- stores Every module that interacts with state must expose a namespaced vuex store and registered in
/stores/index.js
. - api routes Every module that interacts with the backend api must expose routes and must be registered in `/api_routes.
- stores Every module that has pages, meaning that has routes for the frontend, must expose a routes files compatible with vue router and must be registered in
/router/routes.js
.
example
modules/user
---------/store/index.js
/getters.js
/actions.js
----/services/userService.js
/userSettingsService.js
----/pages/profile.vue
/settings.vue
/orders/index.vue
----/components/card/basic.vue
/card/secondary.vue
---/api_routes.js
---/routes.js
modules/product
---------/store/index.js
----/services/userService.js
/userSettingsService.js
----/pages/gallery.vue
/single.vue
/review/product.vue
----/components/card/slider.vue
---/routes.js
- Any module will implement according to its responsibilities.
Common pages like welcome/errors etc.
Packages are sort of like plugins but can be used globally or does not server any specific module. And can act independently.
Plugins are packages and 3rd party libraries but up for modifications. Like you can set the timezone for moment in this section. Plugins are booted when the application boots.
The main vue router. Allowed for modification as you wish.
The main state manager. Allowed for modification as you wish.
The glue of all the modules, for the api-router
The main entry point. That binds everything.
Bootstraps the application.
a config file.
For globaly functions. Will be deprecated.