Skip to content

Commit

Permalink
Allow ipl-data-row to accept numbers as values
Browse files Browse the repository at this point in the history
  • Loading branch information
inkfarer committed Jan 13, 2024
1 parent fcc0aca commit 64fbfaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/iplDataRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineComponent({
required: true
},
value: {
type: [String, null] as PropType<string | undefined | null>,
type: [String, Number, null] as PropType<string | number | undefined | null>,
default: null
},
copiable: {
Expand All @@ -49,7 +49,7 @@ export default defineComponent({
setup(props) {
return {
onCopy() {
navigator.clipboard.writeText(props.value ?? '').catch(e => {
navigator.clipboard.writeText(String(props.value ?? '')).catch(e => {
console.error('Failed to copy value', e);
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/stringHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export function formatNumber(value: number): string {
return new Intl.NumberFormat('en-US').format(value);
}

export function isBlank(value?: string | null): boolean {
export function isBlank(value?: unknown): boolean {
return value === null || value === undefined || String(value).trim() === '';
}

0 comments on commit 64fbfaa

Please sign in to comment.