Remove unnecessary variables and add refactored functionality to purchase price

This commit is contained in:
benguozakinci@gmail.com 2021-07-02 17:35:07 +03:00
parent 9301c7e285
commit 52a90e05be

View File

@ -35,7 +35,6 @@ const app = new Vue({
',.', ',.',
',,' ',,'
], ],
splice_value: null,
} }
}, },
@ -63,8 +62,9 @@ const app = new Vue({
for (let item of this.regex_condition) { for (let item of this.regex_condition) {
if (this.form.purchase_price.includes(item)) { if (this.form.purchase_price.includes(item)) {
this.splice_value = this.form.purchase_price.replace(item, ''); const removeLastChar = newVal.length - 1
this.form.purchase_price = this.splice_value; const inputShown = newVal.slice(0, removeLastChar)
this.form.purchase_price = inputShown;
} }
} }
}, },