Skip to content

Commit

Permalink
fix modelValue null handling
Browse files Browse the repository at this point in the history
  • Loading branch information
borosr committed Aug 6, 2024
1 parent e4bc370 commit 6e6694e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gwservices/fp-money",
"version": "2.0.2",
"version": "2.0.3-next.5",
"private": false,
"description": "Input formatter and currency selector",
"repository": {
Expand Down Expand Up @@ -41,7 +41,8 @@
"test": "vitest run",
"testui": "vitest --ui",
"coverage": "vitest run --coverage",
"vitestwatch": "vitest watch"
"vitestwatch": "vitest watch",
"deploy:next": "npm run build && npm version prerelease --no-git-tag-version --preid=next && npm publish"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
Expand Down
8 changes: 5 additions & 3 deletions src/fp-money/component.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script lang="ts">
import { defineComponent } from 'vue'
import {defineComponent, PropType} from 'vue'
import FPMoney, { Constructor, currencies, Values } from './fp-money'
export default defineComponent({
name: 'Fpmoney',
emits: ['update:modelValue', 'update:currency', 'update:locale', 'update:format', 'update:display'],
props: {
modelValue: {
type: [String, Number],
required: true
type: [String, Number] as PropType<string | number | null>,
validator: (v): boolean => {
return ['string', 'number'].includes(typeof v) || v === null
}
},
currency: {
type: String,
Expand Down

0 comments on commit 6e6694e

Please sign in to comment.