bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.78k stars 1.32k forks source link

[Question] Naming conventions #207

Open timlkelly opened 4 years ago

timlkelly commented 4 years ago

I am curious about the naming conventions used in this boilerplate setup compared to what is generated by the Vue CLI. I realize a lot of this is a personal preference, but I would like to hear why these choices were made.

Regarding Vuex, this project uses state/store.js vs store/index.js.

This project uses kebab-case over PascalCase for component names.

Lastly, I see that there are components prefixed with an underscore. In other frameworks I have used, this indicates that the file is a partial. However, here they look to be full stand-alone components.

marceloavf commented 4 years ago

There is some explanations in Vue Style Guide which I think was written by him.

Those underscore components are automatically imported in all files, which you don't have to worry about importing them manually, but good question thought.

axdyng commented 4 years ago

Those underscore components are automatically imported in all files, which you don't have to worry about importing them manually, but good question thought.

which part does it imports automatically? From what I see, inside routes.js, it is still importing _404.vue manually: component: require('@views/_404.vue').default

Also, a very newbie question - if this project is following kebab-case naming

Do you then name your vue files inside view folder: forgot-password.vue instead of ForgotPassword.vue? Does it apply to route.name property too? I recall that it is better to use PascalCase due to editor autocompletion?

Thanks in advance.