fix(front): small things
This commit is contained in:
parent
0d743b7ca2
commit
5b8ca3c38e
|
@ -42,16 +42,12 @@ const styles = {
|
||||||
...widths, ...sizes
|
...widths, ...sizes
|
||||||
} as const satisfies Record<Key, string | ((w: string) => string)>
|
} as const satisfies Record<Key, string | ((w: string) => string)>
|
||||||
|
|
||||||
const getStyle = (props: Partial<WidthProps>) => (key: Key): string =>
|
const getStyle = (props: Partial<WidthProps>) => (key: Key) =>
|
||||||
// @ts-expect-error Typescript is hard
|
|
||||||
typeof styles[key] === 'function' && key in props
|
typeof styles[key] === 'function' && key in props
|
||||||
// @ts-expect-error Typescript is hard
|
|
||||||
? styles[key](
|
? styles[key](
|
||||||
// TODO: Make the typescript compiler understand `key in props`
|
// @ts-expect-error Typescript is hard. Make the typescript compiler understand `key in props`
|
||||||
// @ts-expect-error Typescript is hard
|
|
||||||
props[key]
|
props[key]
|
||||||
)
|
)
|
||||||
|
|
||||||
: styles[key]
|
: styles[key]
|
||||||
|
|
||||||
// All keys are exclusive
|
// All keys are exclusive
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { computed, ref } from 'vue'
|
||||||
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load and cache all tags
|
||||||
|
*
|
||||||
|
* @param current
|
||||||
|
*/
|
||||||
|
export const useTags = <T> (current = ref<string[]>([])) => {
|
||||||
|
const store = useStore()
|
||||||
|
|
||||||
|
const tags = computed(() => store.state.ui.tags)
|
||||||
|
}
|
||||||
|
|
||||||
|
// alternative ways to generate tags
|
Loading…
Reference in New Issue