mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
refactor logic for MAX-btn and added validation for check integer-type
This commit is contained in:
@@ -151,7 +151,7 @@ import SwiperCore from 'swiper/core';
|
|||||||
import {Navigation } from "swiper/modules";
|
import {Navigation } from "swiper/modules";
|
||||||
|
|
||||||
import { useVuelidate } from '@vuelidate/core'
|
import { useVuelidate } from '@vuelidate/core'
|
||||||
import { maxValue, minValue, required, numeric } from "@vuelidate/validators";
|
import { maxValue, minValue, required, numeric, integer } from "@vuelidate/validators";
|
||||||
|
|
||||||
SwiperCore.use([Navigation]);
|
SwiperCore.use([Navigation]);
|
||||||
|
|
||||||
@@ -187,8 +187,8 @@ export default {
|
|||||||
},
|
},
|
||||||
validations() {
|
validations() {
|
||||||
return {
|
return {
|
||||||
amountCrystals: { required, numeric, minValue: minValue(1), maxValue: maxValue(24) },
|
amountCrystals: { required, numeric, minValue: minValue(1), maxValue: maxValue(24), integer },
|
||||||
amountDeposit: { required, numeric, minValue: minValue(1), maxValue: maxValue(this.balance) }
|
amountDeposit: { required, numeric, minValue: minValue(1), maxValue: maxValue(this.balance), integer }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -406,15 +406,13 @@ export default {
|
|||||||
}
|
}
|
||||||
return word
|
return word
|
||||||
},
|
},
|
||||||
clickedBtnChoice(index, content) {
|
async clickedBtnChoice(index, content) {
|
||||||
this.clickedBtn = index
|
this.clickedBtn = index
|
||||||
if (content === 'max') {
|
if (content === 'max') {
|
||||||
setTimeout( async () => {
|
await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
|
||||||
await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
|
.then((response) => {
|
||||||
.then((response) => {
|
this.amountDeposit = parseInt(response.currentMoney)
|
||||||
this.amountDeposit = response.currentMoney
|
})
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.amountDeposit = content
|
this.amountDeposit = content
|
||||||
|
|||||||
Reference in New Issue
Block a user