Files
exchange-2.0/resources/assets/vue/general/mixins/formHandler.js
T
2022-08-11 23:21:34 +08:00

51 lines
1.4 KiB
JavaScript
Vendored

import errorMessageHandler from "./errorMessageHandler";
import {VMoney} from 'v-money'
export default {
props: {
section:{
type: String,
required: true
},
data: {
type: Object,
default: null
}
},
created() {
if(this.data){
this.parameters = this.data;
this.parameters.gRecaptchaResponse = null
}
},
watch: {
'data': function() {
this.parameters = this.data;
}
},
data() {
return {
isLoading: false,
error: '',
money: {decimal: '.',thousands: ',', precision: 2},
moneyV2: {decimal: '.',thousands: '', precision: 2},
productPrice: {decimal: '.',thousands: ',', precision: 3},
exchangeRate: {decimal: '.', thousands: '', precision: 5},
percentage: {decimal: '.', thousands: '', precision: 2, suffix: '%'},
threeDecimalPercentage: {decimal: '.', thousands: '', precision: 3, suffix: '%'},
integer: {decimal: '', thousands: '', precision: 0},
}
},
methods: {
formHandler(errorMessage){
this.isLoading = false;
this.updateList();
this.errorMessageHandler(errorMessage);
}
},
mixins: [errorMessageHandler],
directives: {money: VMoney}
}