fix #29. amount value always positive
This commit is contained in:
parent
7a61dbef28
commit
db4f3c45c4
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, PropType, computed } from 'vue';
|
||||
import { defineComponent, ref, PropType, computed, watch } from 'vue';
|
||||
import { useBalanceStore } from '../store';
|
||||
import { hasPermission, useUserStore } from '@flaschengeist/api';
|
||||
import PERMISSIONS from '../permissions';
|
||||
|
@ -58,6 +58,9 @@ export default defineComponent({
|
|||
? <FG.User>props.user
|
||||
: <FG.User>userStore.users.find((a) => a.userid === <string>props.user)
|
||||
);
|
||||
watch(amount, (a) => {
|
||||
amount.value = Math.abs(a);
|
||||
});
|
||||
return { changeBalance, addShortcut, canAddCredit, amount };
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue