- Main components have to be exported in
./src/main.js
. Main Components should be in folder./src/components
. - Ui Elements for main components should be in
./src/components/ui
so everyone who contributes can see if there is an element/component already for their use. - Components should be as small as possible to make the code easier to access and understand, thats why the directory structure has importance.
- Every logic/function according to articles/items/cart or anything else should be in the
cartStore
in./src/stores/cart.js
- reason is as follows - all components get their data with so called props which are not "reactive" by nature. We want to trigger a rerender if we change/add/edit... items thats why anything according to that should be in the cartStore. Read the cartStore carefully and use the already existing states to grant a clean rerender/reactive process. The props all get updated as soon as the main states get updated in thecartStore
-> rerender --> profit...
Try to understand this structure and adopt it with new components for easy implementation without much effort.
Real documentation is coming soon...