This commit is contained in:
@@ -27,9 +27,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
internalValue: null,
|
||||
internalChange: false,
|
||||
currencyName: window.$gz.locale.getCurrencyName(),
|
||||
languageName: window.$gz.locale.getBrowserFirstLanguage(),
|
||||
internalChange: false
|
||||
languageName: window.$gz.locale.getBrowserFirstLanguage()
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -51,30 +51,23 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleInput(value) {
|
||||
let ret = parseCurrency(value, {
|
||||
let parsedValue = parseCurrency(value, {
|
||||
currency: this.currencyName,
|
||||
locale: this.languageName
|
||||
});
|
||||
if (this.internalChange) {
|
||||
this.internalValue = ret;
|
||||
this.internalValue = parsedValue;
|
||||
this.internalChange = false;
|
||||
return;
|
||||
}
|
||||
console.log(
|
||||
`handleInput, comparing value of ${value} to internalValue of ${this.internalValue}`
|
||||
);
|
||||
if (ret == this.internalValue) {
|
||||
|
||||
if (parsedValue == this.internalValue) {
|
||||
//nothing changed
|
||||
return;
|
||||
}
|
||||
|
||||
// let ret = parseCurrency(value, {
|
||||
// currency: this.currencyName,
|
||||
// locale: this.languageName
|
||||
// });
|
||||
console.log("currency-control emitting INPUT on value", ret);
|
||||
this.$emit("input", ret);
|
||||
this.internalValue = ret;
|
||||
this.$emit("input", parsedValue);
|
||||
this.internalValue = parsedValue;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user