vue code specifications of some common sense (small summary)

Wrote vue project so on, is simply crazy to be eslint tortured, but was tortured to get used to, summarize it

- Folder a "big hump nomenclature" 

- File name a "big hump nomenclature"

- id: using "small hump nomenclature"

- class: a "scribing method in nomenclature"

Note: id and class names as lean as possible, just enough to convey the meaning, it helps to understand, but also can improve the code efficiency
Note acronym name, but not blindly abbreviation;
1,2,3 allowed named by number;
Avoid class and id the same name;
id attention to one area of ​​the parent container identification module or page name must be unique, not free to create a new id;
class for a certain type of object identification, naming must be concise;
Maximize reuse code modules, combined with the possible embodiment the style;
Rule name should not contain information related to a specific display color, location, etc., should be named with meaning, rather than the result name.

(1) non-breaking spaces before the opening brace;

(2) after the left brace wrap;

(3) before the closing brace wrap;

(4) after the closing brace else there is no line feed code, etc.;

(5) after the closing brace to terminate must wrap.

(6) space does not occur between the middle and the left and right parentheses character.

Guess you like

Origin www.cnblogs.com/fdd-111/p/11839912.html
Recommended