diff --git a/README.md b/README.md index 1094dab9..054f28c5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ RSSA - Front End + +> [!IMPORTANT] +> Read this following instructions before doing your job + ## Framework Guide - [Vue Style Guide](https://vuejs.org/style-guide) @@ -54,9 +58,30 @@ The basic development workflow follows these steps: ### Create Pages in `pages/` +- Define permissions and guards for each page. - Pages load the appropriate flow from `components/flow/`. - They do not contain UI or logic directly, just route level layout or guards. +## Code Conventions + +- Under the script setup block, putting things in group with the following order: + - Imports → all dependencies, sorted by external, alias (~), and relative imports. + - Props & Emits → clearly define component inputs & outputs. + - State & Computed → all ref, reactive, and computed variables grouped together. + - Lifecycle Hooks → grouped by mounting → updating → unmounting order. + - Functions → async first (fetching, API calls), then utility & event handlers. + - Watchers → if needed, put them at the bottom. + - Template → keep clean and minimal logic, use methods/computed instead of inline JS. +- Declaration Naming + - Uses PascalCase for `type` naming + - Uses camelCase for `variable` and `const` naming + - Underscore can be used to indicates that a variable has derived from an attribute of an object
+ for example: `person_name` indicates it is an attribute `name` from object `person` +- Looping + - Uses `i`, `j`, `k` as variable for `for` looping index + - Uses `item` as object instantition for `forEach` loop callback + - Uses `item` as object instantition for `v-for` loop callback in the template + ## Git Workflows The basic git workflow follows these steps: diff --git a/app/app.vue b/app/app.vue index ad991e5e..29936a9b 100644 --- a/app/app.vue +++ b/app/app.vue @@ -14,5 +14,7 @@ const dir = computed(() => (textDirection.value === 'rtl' ? 'rtl' : 'ltr')) + + diff --git a/app/components/flow/patient/list.vue b/app/components/flow/patient/list.vue index 8537ce3b..3131d81d 100644 --- a/app/components/flow/patient/list.vue +++ b/app/components/flow/patient/list.vue @@ -6,7 +6,6 @@ import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next' const data = ref([]) const refSearchNav: RefSearchNav = { - onClick: () => { // open filter modal }, @@ -29,7 +28,7 @@ const recItem = ref(null) const hreaderPrep: HeaderPrep = { title: 'Pasien', - icon: 'i-lucide-add', + icon: 'i-lucide-users', addNav: { label: 'Tambah', onClick: () => navigateTo('/patient/add'), @@ -102,7 +101,7 @@ provide('rec_item', recItem)