From 660c250ad861503034b58442f106a33719fbb6f9 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 6 Dec 2023 12:42:56 +0100 Subject: [PATCH] Formatting fix --- Frontend/README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Frontend/README.md b/Frontend/README.md index 2d82fee..20374a3 100644 --- a/Frontend/README.md +++ b/Frontend/README.md @@ -47,28 +47,38 @@ npm run lint ## Structure of Vuejs 3 components and views in this project -For this document's needs components and views will be named "modules" even though this is not a correct term for these files officialy. +For this document's needs components and views will be named "modules" even though this is not a correct term for these files officially. ### Main structure -Each file should start with \ tag followed by \ tag. If \ tag is used (which should be avoided, this project uses Tailwind CSS for styling) it should be placed at the end of the file. +- \ +- \ +- \ - if really needed ### Scripts -Elements should be placed in this order: - - Props - constant defined by defineProps function - - Emits - constant defined by defineEmits function - - Refs - contstans defined by ref functions with appropriate values +#### Elements should be placed in this order: + - Props - constant defined by defineProps function, named "props" in code +This name allows to have readable code sending data to parent module: +```TS + props.exampleProp +``` + - Emits - constant defined by defineEmits function, named "emit" in code. This name allows to have readable code sending data to parent module: +```TS + emit("update:modelValue", exampleVariable) +``` + - Refs - constants defined by ref functions with appropriate values - Other functions -Rules regarding functions: +#### Rules regarding functions: - Functions ought to have descriptive name - - Ought to do one thing. ie. function fetchRequest should send request, but not prepare request body + - Ought to do one thing. ie. function sendRequest should send request, but not prepare request body or process response data - In practice, if function has more than 10 SLoC, it probably should be split - DO NOT use "any" type. Just don't. - - Function used in current function should be placed below it (if posible, as function can be called from many places in the code) - - + - Function used in other function should be placed below it (if posible, as function can be called from many places in the code) -Rules regarding variables and refs: - - +#### Rules regarding variables and refs: + - Variables ought to have descriptive name + +In cases not covered in this convention, TypeScript, VueJS 3 conventions and good programming practices are applied