fix(front): small things
This commit is contained in:
parent
0d743b7ca2
commit
5b8ca3c38e
|
@ -42,16 +42,12 @@ const styles = {
|
|||
...widths, ...sizes
|
||||
} as const satisfies Record<Key, string | ((w: string) => string)>
|
||||
|
||||
const getStyle = (props: Partial<WidthProps>) => (key: Key): string =>
|
||||
// @ts-expect-error Typescript is hard
|
||||
const getStyle = (props: Partial<WidthProps>) => (key: Key) =>
|
||||
typeof styles[key] === 'function' && key in props
|
||||
// @ts-expect-error Typescript is hard
|
||||
? styles[key](
|
||||
// TODO: Make the typescript compiler understand `key in props`
|
||||
// @ts-expect-error Typescript is hard
|
||||
// @ts-expect-error Typescript is hard. Make the typescript compiler understand `key in props`
|
||||
props[key]
|
||||
)
|
||||
|
||||
: styles[key]
|
||||
|
||||
// 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