-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(guidelines): remove old guidelines from lite readme
- Loading branch information
Showing
5 changed files
with
85 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Icons | ||
|
||
XO Lite / 6 / Core projects are using Font Awesome 6 Free. | ||
|
||
Icons can be displayed with the `UiIcon` component. | ||
|
||
The component takes an `icon` prop that should be an icon object imported from `@fortawesome/free-solid-svg-icons` or `@fortawesome/free-regular-svg-icons`. | ||
|
||
If the `icon` prop is `undefined`, then the component will be ignored (no need to use an additional `v-if` condition). | ||
|
||
Use the `busy` prop to display a loader icon. | ||
|
||
## Example | ||
|
||
```vue | ||
<template> | ||
<div> | ||
<UiIcon :icon="faDisplay" /> | ||
</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import UiIcon from '@/components/ui/icon/UiIcon.vue' | ||
import { faDisplay } from '@fortawesome/free-solid-svg-icons' | ||
</script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Stores | ||
|
||
Stores definition must use Pinia setup function. | ||
|
||
State are `ref` | ||
|
||
Getters are `computed` | ||
|
||
Actions/Mutations are simple functions | ||
|
||
## Naming convention | ||
|
||
For a `foobar` store, create a `store/foobar.store.ts` then use `defineStore('foobar', setupFunc)` | ||
|
||
## Example | ||
|
||
```typescript | ||
import { computed, ref } from 'vue' | ||
|
||
export const useFoobarStore = defineStore('foobar', () => { | ||
const aStateVar = ref(0) | ||
const otherStateVar = ref(0) | ||
const aGetter = computed(() => aStateVar.value * 2) | ||
const anAction = () => (otherStateVar.value += 10) | ||
|
||
return { | ||
aStateVar, | ||
otherStateVar, | ||
aGetter, | ||
anAction, | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters