Add frontend 2.0

This commit is contained in:
2022-01-22 19:28:06 +01:00
parent ff22127baa
commit e0efd9dc41
28 changed files with 1954 additions and 140 deletions

View File

@@ -0,0 +1,18 @@
import { readonly, ref } from 'vue';
export function randomLabel(options: string[]) {
const label = ref<string>();
const randomLabel = () => {
let newLabel;
do {
newLabel = options[Math.floor(Math.random() * options.length)];
} while (newLabel === label.value);
return newLabel;
};
label.value = randomLabel();
return {
label: readonly(label),
update: () => (label.value = randomLabel()),
};
}