diff --git a/package.json b/package.json index c97b602..675a94d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gwservices/fp-money", - "version": "2.0.1", + "version": "2.0.2", "private": false, "description": "Input formatter and currency selector", "repository": { diff --git a/src/fp-money/component.vue b/src/fp-money/component.vue index 7bf4148..89a005f 100644 --- a/src/fp-money/component.vue +++ b/src/fp-money/component.vue @@ -94,7 +94,7 @@ export default defineComponent({ }, watch: { modelValue(newValue, oldValue) { - if (!this.fpmoney || newValue.toString() === oldValue.toString()) { + if (!this.fpmoney || newValue?.toString() === oldValue?.toString()) { return } this.fpmoney.setValue(newValue) @@ -106,13 +106,13 @@ export default defineComponent({ this.fpmoney.setCurrencies(newValue) }, currency(newValue, oldValue) { - if (!this.fpmoney || newValue.toLowerCase() === oldValue.toLowerCase()) { + if (!this.fpmoney || newValue?.toLowerCase() === oldValue?.toLowerCase()) { return } this.fpmoney.setCurrency(newValue) }, locale(newValue, oldValue) { - if (!this.fpmoney || newValue.toLowerCase() === oldValue.toLowerCase()) { + if (!this.fpmoney || newValue?.toLowerCase() === oldValue?.toLowerCase()) { return } this.fpmoney.setLocale(newValue)