complete store refactor; moved form inputs into store; refactored components out of TimedOrderEntry
This commit is contained in:
26
src/components/Amount.vue
Normal file
26
src/components/Amount.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<v-text-field label='Amount' type="number" step="1" variant="outlined" aria-valuemin="0" min="0"
|
||||
v-model="s.amount" :rules="[validateRequired,validateAmount]" v-auto-select>
|
||||
<template v-slot:append-inner>
|
||||
<v-btn @click="s.amountIsTokenA=!s.amountIsTokenA" variant="outlined" class="mr-2">
|
||||
{{ s.amountIsTokenA ? s.tokenA.symbol : s.tokenB.symbol }}
|
||||
</v-btn>
|
||||
<v-btn :text="s.amountIsTotal ? 'total' : 'per tranche'" variant="outlined"
|
||||
@click="s.amountIsTotal=!s.amountIsTotal" class="total"/>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {useStore} from "@/store/store";
|
||||
import {validateRequired, validateAmount, vAutoSelect} from "@/misc.js";
|
||||
|
||||
const s = useStore()
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "src/styles/vars" as *;
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user