🐛 Fixes type error
This commit is contained in:
parent
75aed63005
commit
180faecddf
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,3 +26,5 @@ dist-ssr
|
|||||||
bun.lockb
|
bun.lockb
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.firebaserc
|
||||||
|
firebase.json
|
||||||
|
18
src/App.vue
18
src/App.vue
@ -17,16 +17,11 @@
|
|||||||
|
|
||||||
<div v-if="problem" class="flex">
|
<div v-if="problem" class="flex">
|
||||||
<div class="flex items-end justify-center flex-col h-full gap-y-2 p-2">
|
<div class="flex items-end justify-center flex-col h-full gap-y-2 p-2">
|
||||||
<Number
|
<Number :number="problem.a" :options="options" class="mx-2" />
|
||||||
:number="problem.a"
|
|
||||||
:options="{ spacing: +spacing, fill: fill }"
|
|
||||||
class="mx-2"
|
|
||||||
/>
|
|
||||||
<Number
|
<Number
|
||||||
:number="problem.b"
|
:number="problem.b"
|
||||||
:options="{
|
:options="{
|
||||||
spacing: +spacing,
|
...options,
|
||||||
fill: fill,
|
|
||||||
prefix: problem.operator,
|
prefix: problem.operator,
|
||||||
}"
|
}"
|
||||||
class="mx-2"
|
class="mx-2"
|
||||||
@ -37,7 +32,7 @@
|
|||||||
<Number
|
<Number
|
||||||
:data-shown="shown"
|
:data-shown="shown"
|
||||||
:number="problem.answer"
|
:number="problem.answer"
|
||||||
:options="{ spacing: +spacing, fill: fill }"
|
:options="options"
|
||||||
class="mx-2 data-[shown=false]:opacity-0"
|
class="mx-2 data-[shown=false]:opacity-0"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -93,7 +88,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { computed, onMounted, ref } from "vue";
|
||||||
import { levels, Problem } from "./composables/levels.ts";
|
import { levels, Problem } from "./composables/levels.ts";
|
||||||
import Number from "./components/Number.vue";
|
import Number from "./components/Number.vue";
|
||||||
|
|
||||||
@ -104,6 +99,11 @@ const shown = ref(false);
|
|||||||
const openSettings = ref(false);
|
const openSettings = ref(false);
|
||||||
const spacing = ref("4");
|
const spacing = ref("4");
|
||||||
const fill = ref(true);
|
const fill = ref(true);
|
||||||
|
const options = computed(() => ({
|
||||||
|
spacing: +spacing.value,
|
||||||
|
fill: fill.value,
|
||||||
|
prefix: undefined,
|
||||||
|
}));
|
||||||
|
|
||||||
function next() {
|
function next() {
|
||||||
problem.value = levels[level.value].generate();
|
problem.value = levels[level.value].generate();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user