The style guide for this project is mainly based on the official style guide . It is recommended to read the guide before you start using the project, which will help you write more standardized and unified code. Most of these rules are also configured in eslint-plugin-vue. When the rules are not followed, will throw an error. For details, see eslint section.
Of course, there are some special specifications that cannot be verified by eslint. You need to pay attention to yourself and follow. The most important thing is the naming rules for files. Take the example of
Component files start with uppercase (PascalCase), which is also official recommended。
But except for
.js files follow
views file, the
.vue files representing the routes path all use
kebab-case, and the same rules are used for folders.
The use of a kebab-case to name
views is mainly due to the following considerations.
kebab-caseis also one of the officially recommended naming conventions Document
viewsrepresents a route, so it needs to be distinguished from
urlof the page is follow
kebab-case, such as
https://www.xxx.admin/export-excel. So the
viewcorresponding to the route should be kept uniform.
- No case sensitive issues